Home / Class/ TestResolver Class — spring-boot Architecture

TestResolver Class — spring-boot Architecture

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

Entity Profile

Relationship Graph

Source Code

core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataLocationResolversTests.java lines 188–219

	static class TestResolver implements ConfigDataLocationResolver<TestConfigDataResource> {

		private final boolean optionalResource;

		TestResolver() {
			this(false);
		}

		private TestResolver(boolean optionalResource) {
			this.optionalResource = optionalResource;
		}

		@Override
		public boolean isResolvable(ConfigDataLocationResolverContext context, ConfigDataLocation location) {
			String name = getClass().getName();
			name = name.substring(name.lastIndexOf("$") + 1);
			return location.hasPrefix(name + ":");
		}

		@Override
		public List<TestConfigDataResource> resolve(ConfigDataLocationResolverContext context,
				ConfigDataLocation location) {
			return Collections.singletonList(new TestConfigDataResource(this.optionalResource, this, location, false));
		}

		@Override
		public List<TestConfigDataResource> resolveProfileSpecific(ConfigDataLocationResolverContext context,
				ConfigDataLocation location, Profiles profiles) {
			return Collections.singletonList(new TestConfigDataResource(this.optionalResource, this, location, true));
		}

	}

Domain

Analyze Your Own Codebase

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

Try Supermodel Free