@Test @SuppressWarnings("rawtypes") public void isExplicitlyEnabled() throws Exception { this.context = new AnnotationConfigApplicationContext(); PropertySource<?> propertySource = new MapPropertySource("test", Collections .<String, Object>singletonMap(this.property + ".enabled", false)); this.context.getEnvironment().getPropertySources().addFirst(propertySource); this.context.register(this.configClass); this.context.refresh(); ((AbstractEndpoint) getEndpointBean()).setEnabled(true); assertThat(getEndpointBean().isEnabled()).isTrue(); }