### Question:
ApiMediationClientService { public boolean register() throws ServiceDefinitionException { ApiInfo apiInfo = new ApiInfo(SERVICE_ID, GATEWAY_URL, "1.0.0", null, null); Authentication authentication = new Authentication("bypass", null); Ssl ssl = new Ssl(dcConfig.isSslEnabled(), dcConfig.isVerifyCerts(), dcConfig.getSslProtocol(), dcConfig.getKeyAlias(), dcConfig.getKeyPassword().toCharArray(), dcConfig.getKeyStore(), dcConfig.getKeyStorePassword().toCharArray(), dcConfig.getKeyStoreType(), dcConfig.getTrustStore(), dcConfig.getTrustStorePassword().toCharArray(), dcConfig.getTrustStoreType()); Route apiRoute = new Route(GATEWAY_URL, "/" + SERVICE_ID + "/" + GATEWAY_URL); ApiMediationServiceConfig apiConfig = ApiMediationServiceConfig.builder() .apiInfo(Collections.singletonList(apiInfo)) .authentication(authentication) .routes(Collections.singletonList(apiRoute)) .description("Example for API Mediation Client registration") .title("API Mediation Client Registration") .serviceId(SERVICE_ID) .baseUrl(dcConfig.getScheme() + ": .healthCheckRelativeUrl("") .homePageRelativeUrl("") .statusPageRelativeUrl("") .discoveryServiceUrls(dcConfig.getDiscoveryServiceUrls()) .ssl(ssl) .preferIpAddress(false) .serviceIpAddress("0.0.0.0") .build(); apiMediationClient.register(apiConfig); return true; } ApiMediationClientService(@Autowired DiscoverableClientConfig dcConfig); boolean register(); boolean unregister(); boolean isRegistered();  }### Answer:
@Test public void registerTest() throws ServiceDefinitionException { assertTrue(apiMediationClientService.register()); }
@Test public void registerTest_duplicate() throws ServiceDefinitionException { exceptionRule.expect(ServiceDefinitionException.class); apiMediationClientService.register(); apiMediationClientService.register(); }