### Question:
RegistryServiceImpl implements RegistryService { @Override public API add(API api) { api.setId(UUID.randomUUID().toString()); jpaTemplate.tx( TransactionType.Required, entityManager -> { entityManager.persist(mapTo(api)); entityManager.flush(); }); return api; }  @Override API add(API api); @Override void definition(API api, InputStream inputStream); @Override void delete(String id); @Override void update(API api); @Override API get(String id); @Override Collection<API> list(); @Override void addMeta(API api, Map<String, String> meta); @Override void deleteMeta(API api, String key); @Override void updateMeta(API api, Map<String, String> meta); @Override Map<String, String> getMeta(API api); @Override RestResource addRestResource(API api, RestResource restResource); @Override void deleteRestResource(API api, RestResource restResource); @Override Collection<RestResource> listRestResources(API api); @Override RestResource getRestResource(String id); @Override Collection<RestResource> listRestResources(Policy policy); @Override Policy addPolicy(Policy policy); @Override void deletePolicy(String id); @Override Policy getPolicy(String id); @Override Collection<Policy> listPolicies(); @Override void applyPolicy(
            String restResourceId, String policyId, int order, Map<String, String> params); @Override void unapplyPolicy(String restResourceId, String policyId); @Override Map<Integer, Policy> listAppliedPolicies(RestResource restResource); @Override void addPolicyMeta(Policy policy, Map<String, String> meta); @Override void deletePolicyMeta(Policy policy, String key); @Override void updatePolicyMeta(Policy policy, Map<String, String> meta); @Override Map<String, String> getPolicyMeta(Policy policy);  }### Answer:
@Test public void testSimpleAddApi() throws Exception { API api = new API(); api.setContext("/simple"); api.setDescription("Simple API"); api.setName("Simple"); registryService.add(api); ClientDataSource dataSource = getDataSource(); try (Connection connection = dataSource.getConnection()) { try (Statement statement = connection.createStatement()) { try (ResultSet resultSet = statement.executeQuery("select * from VINEYARD.API where name='Simple'")) { resultSet.next(); Assert.assertNotNull(resultSet.getString("ID")); Assert.assertEquals(resultSet.getString("NAME"), "Simple"); Assert.assertEquals(resultSet.getString("DESCRIPTION"), "Simple API"); Assert.assertEquals(resultSet.getString("CONTEXT"), "/simple"); Assert.assertFalse(resultSet.next()); } } } }