Home / Class/ LogUpdateEventTests Class — spring-boot Architecture

LogUpdateEventTests Class — spring-boot Architecture

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

Entity Profile

Source Code

buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/LogUpdateEventTests.java lines 33–71

class LogUpdateEventTests {

	@Test
	void readAllWhenSimpleStreamReturnsEvents() throws Exception {
		List<LogUpdateEvent> events = readAll("log-update-event.stream");
		assertThat(events).hasSize(7);
		assertThat(events.get(0))
			.hasToString("Analyzing image '307c032c4ceaa6330b6c02af945a1fe56a8c3c27c28268574b217c1d38b093cf'");
		assertThat(events.get(1))
			.hasToString("Writing metadata for uncached layer 'org.cloudfoundry.openjdk:openjdk-jre'");
		assertThat(events.get(2))
			.hasToString("Using cached launch layer 'org.cloudfoundry.jvmapplication:executable-jar'");
	}

	@Test
	void readAllWhenAnsiStreamReturnsEvents() throws Exception {
		List<LogUpdateEvent> events = readAll("log-update-event-ansi.stream");
		assertThat(events).hasSize(20);
		assertThat(events.get(0).toString()).isEmpty();
		assertThat(events.get(1)).hasToString("Cloud Foundry OpenJDK Buildpack v1.0.64");
		assertThat(events.get(2)).hasToString("  OpenJDK JRE 11.0.5: Reusing cached layer");
	}

	@Test
	void readSucceedsWhenStreamTypeIsInvalid() throws IOException {
		List<LogUpdateEvent> events = readAll("log-update-event-invalid-stream-type.stream");
		assertThat(events).hasSize(1);
		assertThat(events.get(0)).hasToString("Stream type is out of bounds. Must be >= 0 and < 3, but was 3");
	}

	private List<LogUpdateEvent> readAll(String name) throws IOException {
		List<LogUpdateEvent> events = new ArrayList<>();
		try (InputStream inputStream = getClass().getResourceAsStream(name)) {
			LogUpdateEvent.readAll(inputStream, events::add);
		}
		return events;
	}

}

Analyze Your Own Codebase

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

Try Supermodel Free