Home / Class/ DockerRegistryUserAuthenticationTests Class — spring-boot Architecture

DockerRegistryUserAuthenticationTests Class — spring-boot Architecture

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

Entity Profile

Relationship Graph

Source Code

buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/configuration/DockerRegistryUserAuthenticationTests.java lines 37–64

class DockerRegistryUserAuthenticationTests extends AbstractJsonTests {

	@Test
	void createMinimalAuthHeaderReturnsEncodedHeader() throws IOException, JSONException {
		DockerRegistryUserAuthentication auth = new DockerRegistryUserAuthentication("user", "secret",
				"https://docker.example.com", "docker@example.com");
		String authHeader = auth.getAuthHeader();
		assertThat(authHeader).isNotNull();
		JSONAssert.assertEquals(jsonContent("auth-user-full.json"), decoded(authHeader), true);
	}

	@Test
	void createFullAuthHeaderReturnsEncodedHeader() throws IOException, JSONException {
		DockerRegistryUserAuthentication auth = new DockerRegistryUserAuthentication("user", "secret", null, null);
		String authHeader = auth.getAuthHeader();
		assertThat(authHeader).isNotNull();
		JSONAssert.assertEquals(jsonContent("auth-user-minimal.json"), decoded(authHeader), false);
	}

	private String jsonContent(String s) throws IOException {
		return StreamUtils.copyToString(getContent(s), StandardCharsets.UTF_8);
	}

	private String decoded(String header) {
		return new String(Base64.getUrlDecoder().decode(header));
	}

}

Domain

Analyze Your Own Codebase

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

Try Supermodel Free