Skip to content

Commit 616922e

Browse files
committed
fix test
1 parent 43a9767 commit 616922e

1 file changed

Lines changed: 15 additions & 20 deletions

File tree

dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/agent/DebuggerTransformerTest.java

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import static org.junit.jupiter.api.Assertions.assertEquals;
44
import static org.junit.jupiter.api.Assertions.assertNull;
5+
import static org.junit.jupiter.api.Assertions.assertTrue;
56
import static org.mockito.ArgumentMatchers.any;
67
import static org.mockito.ArgumentMatchers.anyList;
78
import static org.mockito.Mockito.doAnswer;
@@ -158,10 +159,10 @@ public void testDump() {
158159
ArrayList.class,
159160
null,
160161
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());
165166
} finally {
166167
DebuggerTransformer.DUMP_PATH = initialTmpDir;
167168
}
@@ -264,7 +265,7 @@ public void testBlockedProbes() {
264265
getClassFileBytes(String.class));
265266
assertNull(newClassBuffer);
266267
Assertions.assertNotNull(lastResult.get());
267-
Assertions.assertTrue(lastResult.get().isBlocked());
268+
assertTrue(lastResult.get().isBlocked());
268269
Assertions.assertFalse(lastResult.get().isInstalled());
269270
assertEquals("java.lang.String", lastResult.get().getTypeName());
270271
}
@@ -294,7 +295,7 @@ public void classBeingRedefinedNull() {
294295
Assertions.assertNotNull(newClassBuffer);
295296
Assertions.assertNotNull(lastResult.get());
296297
Assertions.assertFalse(lastResult.get().isBlocked());
297-
Assertions.assertTrue(lastResult.get().isInstalled());
298+
assertTrue(lastResult.get().isInstalled());
298299
assertEquals("java.util.ArrayList", lastResult.get().getTypeName());
299300
}
300301

@@ -338,21 +339,15 @@ public void classGenerationFailed() {
338339
assertEquals("logprobe1", probeIdCaptor.getAllValues().get(0).getId());
339340
assertEquals("logprobe2", probeIdCaptor.getAllValues().get(1).getId());
340341
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 "
343343
+ 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:"));
356351
}
357352

358353
@Test

0 commit comments

Comments
 (0)