AsyncHttpRegistryClient implements RegistryClient { @Override public boolean isRunning() { return isRunning; } @Autowired  AsyncHttpRegistryClient(final ApplicationInfo applicationInfo,
                                   final ServiceRegistryProperties serviceRegistryProperties,
                                   final EdisonApplicationProperties edisonApplicationProperties); @PostConstruct void postConstruct(); @Override void registerService(); @Override boolean isRunning();  }
@Test public void shouldDoNothingIfNotEnabled() { TestPropertyValues.of("edison.serviceregistry.enabled=false").applyTo(context); context.register(ApplicationInfoConfiguration.class); context.register(AsyncHttpRegistryClient.class); context.refresh(); RegistryClient bean = context.getBean(RegistryClient.class); assertThat(bean.isRunning(), is(false)); }
@Test public void shouldDoNothingIfNoServersAreSet() { TestPropertyValues .of("edison.serviceregistry.enabled=true") .and("edison.serviceregistry.servers=") .applyTo(context); context.register(ApplicationInfoConfiguration.class); context.register(AsyncHttpRegistryClient.class); context.refresh(); RegistryClient bean = context.getBean(RegistryClient.class); assertThat(bean.isRunning(), is(false)); }
@Test public void shouldDoNothingIfNoServiceAreSet() { TestPropertyValues .of("edison.serviceregistry.enabled=true") .and("edison.serviceregistry.service=") .applyTo(context); context.register(ApplicationInfoConfiguration.class); context.register(AsyncHttpRegistryClient.class); context.refresh(); RegistryClient bean = context.getBean(RegistryClient.class); assertThat(bean.isRunning(), is(false)); }
@Test public void shouldDoNothingIfRegistryDisabled() { TestPropertyValues .of("edison.serviceregistry.enabled=false") .and("edison.serviceregistry.servers=http: .and("edison.serviceregistry.service=http: .applyTo(context); context.register(ApplicationInfoConfiguration.class); context.register(AsyncHttpRegistryClient.class); context.refresh(); RegistryClient bean = context.getBean(RegistryClient.class); assertThat(bean.isRunning(), is(false)); }
@Test public void shouldDoNothingIfNothingConfigured() { context.register(ApplicationInfoConfiguration.class); context.register(AsyncHttpRegistryClient.class); context.refresh(); RegistryClient bean = context.getBean(RegistryClient.class); assertThat(bean.isRunning(), is(false)); }