Home / Class/ ConfigurationPropertiesBindExceptionTests Class — spring-boot Architecture

ConfigurationPropertiesBindExceptionTests Class — spring-boot Architecture

Architecture documentation for the ConfigurationPropertiesBindExceptionTests class in ConfigurationPropertiesBindExceptionTests.java from the spring-boot codebase.

Entity Profile

Source Code

core/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindExceptionTests.java lines 32–57

class ConfigurationPropertiesBindExceptionTests {

	@Test
	void createFromBeanHasDetails() {
		ApplicationContext applicationContext = new AnnotationConfigApplicationContext(Example.class);
		ConfigurationPropertiesBean bean = ConfigurationPropertiesBean.get(applicationContext,
				applicationContext.getBean(Example.class), "example");
		assertThat(bean).isNotNull();
		ConfigurationPropertiesBindException exception = new ConfigurationPropertiesBindException(bean,
				new IllegalStateException());
		assertThat(exception.getMessage()).isEqualTo("Error creating bean with name 'example': "
				+ "Could not bind properties to 'ConfigurationPropertiesBindExceptionTests.Example' : "
				+ "prefix=, ignoreInvalidFields=false, ignoreUnknownFields=true");
		assertThat(exception.getBeanType()).isEqualTo(Example.class);
		assertThat(exception.getBeanName()).isEqualTo("example");
		assertThat(exception.getAnnotation()).isInstanceOf(ConfigurationProperties.class);
		assertThat(exception.getCause()).isInstanceOf(IllegalStateException.class);
	}

	@Component("example")
	@ConfigurationProperties
	static class Example {

	}

}

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free