Home / Class/ PackagePrivateBeanBindingTests Class — spring-boot Architecture

PackagePrivateBeanBindingTests Class — spring-boot Architecture

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

Entity Profile

Relationship Graph

Source Code

core/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/test/PackagePrivateBeanBindingTests.java lines 38–76

class PackagePrivateBeanBindingTests {

	private final List<ConfigurationPropertySource> sources = new ArrayList<>();

	private Binder binder;

	private ConfigurationPropertyName name;

	@BeforeEach
	void setup() {
		this.binder = new Binder(this.sources);
		this.name = ConfigurationPropertyName.of("foo");
	}

	@Test
	void bindToPackagePrivateClassShouldBindToInstance() {
		MockConfigurationPropertySource source = new MockConfigurationPropertySource();
		source.put("foo.bar", "999");
		this.sources.add(source);
		ExamplePackagePrivateBean bean = this.binder.bind(this.name, Bindable.of(ExamplePackagePrivateBean.class))
			.get();
		assertThat(bean.getBar()).isEqualTo(999);
	}

	static class ExamplePackagePrivateBean {

		private int bar;

		int getBar() {
			return this.bar;
		}

		void setBar(int bar) {
			this.bar = bar;
		}

	}

}

Domain

Analyze Your Own Codebase

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

Try Supermodel Free