Skip to content

Commit

Permalink
Avoid bug in legacy Mockito.
Browse files Browse the repository at this point in the history
  • Loading branch information
raphw committed Jul 11, 2023
1 parent 5b891e1 commit 13f9436
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class ResettableClassFileTransformerSubstitutableTest {
private ResettableClassFileTransformer classFileTransformer, other;

@Test
@JavaVersionRule.Enforce(7) // avoids bug in legacy Mockito
public void testTransformLegacy() throws Exception {
when(classFileTransformer.transform(Foo.class.getClassLoader(),
FOO,
Expand Down Expand Up @@ -72,6 +73,7 @@ public void testTransformModern() throws Exception {
}

@Test
@JavaVersionRule.Enforce(7) // avoids bug in legacy Mockito
public void testReplace() throws Exception {
when(classFileTransformer.transform(Foo.class.getClassLoader(),
FOO,
Expand All @@ -92,7 +94,7 @@ private static class Foo {
/* empty */
}

private static class Holder {
private static class Holder { // avoids bug in legacy Mockito

private static final byte[] FIRST = new byte[]{0}, SECOND = new byte[]{1};
}
Expand Down

0 comments on commit 13f9436

Please sign in to comment.