Merge branch '2.5.x' into 2.6.x

Closes gh-29691
This commit is contained in:
Moritz Halbritter
2022-02-09 14:09:33 +01:00
3 changed files with 32 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -53,6 +53,14 @@ class LogUpdateEventTests {
assertThat(events.get(2).toString()).isEqualTo(" 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).toString())
.isEqualTo("Stream type is out of bounds. Must be >= 0 and < 3, but was 3. Will abort parsing.");
}
private List<LogUpdateEvent> readAll(String name) throws IOException {
List<LogUpdateEvent> events = new ArrayList<>();
try (InputStream inputStream = getClass().getResourceAsStream(name)) {