Skip to content

Commit

Permalink
Fixes tests on older JDKs
Browse files Browse the repository at this point in the history
  • Loading branch information
jqno committed Oct 31, 2023
1 parent 6891a25 commit 058628c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import nl.jqno.equalsverifier.EqualsVerifier;
import nl.jqno.equalsverifier.internal.testhelpers.ExpectedException;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledForJreRange;
import org.junit.jupiter.api.condition.JRE;

/*
* Let's hope nobody needs prefab values for `java.text.AttributedString`,
Expand All @@ -14,6 +16,7 @@
public class ModulesTest {

@Test
@DisabledForJreRange(max = JRE.JAVA_11)
public void giveProperErrorMessage_whenClassUnderTestIsInaccessible() {
ExpectedException
.when(() -> EqualsVerifier.forClass(AttributedString.class).verify())
Expand All @@ -22,6 +25,7 @@ public void giveProperErrorMessage_whenClassUnderTestIsInaccessible() {
}

@Test
@DisabledForJreRange(max = JRE.JAVA_11)
public void giveProperErrorMessage_whenFieldIsInaccessible() {
ExpectedException
.when(() -> EqualsVerifier.forClass(InaccessibleContainer.class).verify())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package nl.jqno.equalsverifier.internal.reflection;

import static nl.jqno.equalsverifier.internal.prefabvalues.factories.Factories.values;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.text.AttributedString;
import java.util.ArrayList;
Expand All @@ -17,6 +20,8 @@
import nl.jqno.equalsverifier.testhelpers.types.TypeHelper.StaticFinalContainer;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledForJreRange;
import org.junit.jupiter.api.condition.JRE;

public class InPlaceObjectAccessorScramblingTest {

Expand Down Expand Up @@ -129,6 +134,7 @@ public void scrambleNestedGenerics() {
}

@Test
@DisabledForJreRange(max = JRE.JAVA_11)
public void scrambleSutInaccessible() {
AttributedString as = new AttributedString("x");

Expand All @@ -139,6 +145,7 @@ public void scrambleSutInaccessible() {
}

@Test
@DisabledForJreRange(max = JRE.JAVA_11)
public void scrambleFieldInaccessible() {
InaccessibleContainer ic = new InaccessibleContainer(new AttributedString("x"));

Expand Down

0 comments on commit 058628c

Please sign in to comment.