### Question:
GatewayInstanceInitializer { @EventListener(ApplicationReadyEvent.class) public void init() { if (gatewayClient.isInitialized()) { return; } log.info("GatewayInstanceInitializer starting asynchronous initialization of Gateway configuration"); instanceLookupExecutor.run( CoreService.GATEWAY.getServiceId(), instance -> { GatewayConfigProperties foundGatewayConfigProperties = process(instance); log.info( "GatewayInstanceInitializer has been initialized with Gateway instance on url: {}: foundGatewayConfigProperties.getScheme(), foundGatewayConfigProperties.getHostname() ); gatewayClient.setGatewayConfigProperties(foundGatewayConfigProperties); applicationEventPublisher.publishEvent(new GatewayLookupCompleteEvent(this)); }, (exception, isStopped) -> { if (Boolean.TRUE.equals(isStopped)) { apimlLog.log("org.zowe.apiml.common.gatewayInstanceInitializerStopped", exception.getMessage()); } } ); }  @EventListener(ApplicationReadyEvent.class) void init();  }### Answer:
@Test(timeout = 2000) public void testInit() { when( eurekaClient.getApplication(SERVICE_ID) ).thenReturn(application); gatewayInstanceInitializer.init(); while (!gatewayClient.isInitialized()) ; GatewayConfigProperties gatewayConfigProperties = gatewayClient.getGatewayConfigProperties(); assertNotNull(gatewayConfigProperties); assertEquals("https", gatewayConfigProperties.getScheme()); assertEquals("localhost:9090", gatewayConfigProperties.getHostname()); }