|
2 | 2 |
|
3 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertNull; |
| 5 | +import static org.junit.jupiter.api.Assertions.assertTrue; |
5 | 6 | import static org.mockito.ArgumentMatchers.any; |
6 | 7 | import static org.mockito.ArgumentMatchers.anyList; |
7 | 8 | import static org.mockito.Mockito.doAnswer; |
@@ -158,10 +159,10 @@ public void testDump() { |
158 | 159 | ArrayList.class, |
159 | 160 | null, |
160 | 161 | getClassFileBytes(ArrayList.class)); |
161 | | - Assertions.assertTrue(instrumentedClassFile.exists()); |
162 | | - Assertions.assertTrue(origClassFile.exists()); |
163 | | - Assertions.assertTrue(instrumentedClassFile.delete()); |
164 | | - Assertions.assertTrue(origClassFile.delete()); |
| 162 | + assertTrue(instrumentedClassFile.exists()); |
| 163 | + assertTrue(origClassFile.exists()); |
| 164 | + assertTrue(instrumentedClassFile.delete()); |
| 165 | + assertTrue(origClassFile.delete()); |
165 | 166 | } finally { |
166 | 167 | DebuggerTransformer.DUMP_PATH = initialTmpDir; |
167 | 168 | } |
@@ -264,7 +265,7 @@ public void testBlockedProbes() { |
264 | 265 | getClassFileBytes(String.class)); |
265 | 266 | assertNull(newClassBuffer); |
266 | 267 | Assertions.assertNotNull(lastResult.get()); |
267 | | - Assertions.assertTrue(lastResult.get().isBlocked()); |
| 268 | + assertTrue(lastResult.get().isBlocked()); |
268 | 269 | Assertions.assertFalse(lastResult.get().isInstalled()); |
269 | 270 | assertEquals("java.lang.String", lastResult.get().getTypeName()); |
270 | 271 | } |
@@ -294,7 +295,7 @@ public void classBeingRedefinedNull() { |
294 | 295 | Assertions.assertNotNull(newClassBuffer); |
295 | 296 | Assertions.assertNotNull(lastResult.get()); |
296 | 297 | Assertions.assertFalse(lastResult.get().isBlocked()); |
297 | | - Assertions.assertTrue(lastResult.get().isInstalled()); |
| 298 | + assertTrue(lastResult.get().isInstalled()); |
298 | 299 | assertEquals("java.util.ArrayList", lastResult.get().getTypeName()); |
299 | 300 | } |
300 | 301 |
|
@@ -338,21 +339,15 @@ public void classGenerationFailed() { |
338 | 339 | assertEquals("logprobe1", probeIdCaptor.getAllValues().get(0).getId()); |
339 | 340 | assertEquals("logprobe2", probeIdCaptor.getAllValues().get(1).getId()); |
340 | 341 | assertEquals(PROBE_ID.getId(), probeIdCaptor.getAllValues().get(2).getId()); |
341 | | - assertEquals( |
342 | | - "Instrumentation failed for " |
| 342 | + assertTrue(strCaptor.getAllValues().get(0).startsWith("Instrumentation failed for " |
343 | 343 | + CLASS_NAME |
344 | | - + ": java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 0", |
345 | | - strCaptor.getAllValues().get(0)); |
346 | | - assertEquals( |
347 | | - "Instrumentation failed for " |
348 | | - + CLASS_NAME |
349 | | - + ": java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 0", |
350 | | - strCaptor.getAllValues().get(1)); |
351 | | - assertEquals( |
352 | | - "Instrumentation failed for " |
353 | | - + CLASS_NAME |
354 | | - + ": java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 0", |
355 | | - strCaptor.getAllValues().get(2)); |
| 344 | + + ": java.lang.ArrayIndexOutOfBoundsException:")); |
| 345 | + assertTrue(strCaptor.getAllValues().get(1).startsWith("Instrumentation failed for " |
| 346 | + + CLASS_NAME |
| 347 | + + ": java.lang.ArrayIndexOutOfBoundsException:")); |
| 348 | + assertTrue(strCaptor.getAllValues().get(2).startsWith("Instrumentation failed for " |
| 349 | + + CLASS_NAME |
| 350 | + + ": java.lang.ArrayIndexOutOfBoundsException:")); |
356 | 351 | } |
357 | 352 |
|
358 | 353 | @Test |
|
0 commit comments