|
40 | 40 | import static org.junit.jupiter.api.Assertions.assertEquals;
|
41 | 41 | import static org.junit.jupiter.api.Assertions.assertNotNull;
|
42 | 42 | import static org.junit.jupiter.api.Assertions.assertTrue;
|
43 |
| -import static org.junit.jupiter.api.Assertions.fail; |
| 43 | +import static org.junit.jupiter.api.Assertions.assertThrows; |
44 | 44 |
|
45 | 45 | /**
|
46 | 46 | * Tests general log implementations
|
@@ -228,16 +228,12 @@ public void testFuzzMessagesSerial() throws Exception {
|
228 | 228 | @Test
|
229 | 229 | public void testReadMarkerCompatibility() throws Exception {
|
230 | 230 | Log l1 = manager.openLog("testx");
|
231 |
| - l1.registerReader(ReadMarker.fromIdentifierOrNow("mark"),new StoringReader(0)); |
232 |
| - l1.registerReader(ReadMarker.fromIdentifierOrTime("mark", Instant.now().minusMillis(100)),new StoringReader(1)); |
233 |
| - try { |
234 |
| - l1.registerReader(ReadMarker.fromIdentifierOrNow("other")); |
235 |
| - fail(); |
236 |
| - } catch (IllegalArgumentException ignored) {} |
237 |
| - try { |
238 |
| - l1.registerReader(ReadMarker.fromTime(Instant.now().minusMillis(100))); |
239 |
| - fail(); |
240 |
| - } catch (IllegalArgumentException ignored) {} |
| 231 | + l1.registerReader(ReadMarker.fromIdentifierOrNow("mark"), new StoringReader(0)); |
| 232 | + l1.registerReader(ReadMarker.fromIdentifierOrTime("mark", Instant.now().minusMillis(100)), new StoringReader(1)); |
| 233 | + |
| 234 | + assertThrows(IllegalArgumentException.class, () -> l1.registerReader(ReadMarker.fromIdentifierOrNow("other"))); |
| 235 | + assertThrows(IllegalArgumentException.class, () -> l1.registerReader(ReadMarker.fromTime(Instant.now().minusMillis(100)))); |
| 236 | + |
241 | 237 | l1.registerReader(ReadMarker.fromNow(), new StoringReader(2));
|
242 | 238 | }
|
243 | 239 |
|
|
0 commit comments