diff --git a/src/test/java/org/jvnet/jenkins/plugins/nodelabelparameter/NextLabelCauseTest.java b/src/test/java/org/jvnet/jenkins/plugins/nodelabelparameter/NextLabelCauseTest.java index a80f398..e51bca4 100644 --- a/src/test/java/org/jvnet/jenkins/plugins/nodelabelparameter/NextLabelCauseTest.java +++ b/src/test/java/org/jvnet/jenkins/plugins/nodelabelparameter/NextLabelCauseTest.java @@ -3,7 +3,6 @@ import hudson.model.FreeStyleBuild; import hudson.model.FreeStyleProject; import nl.jqno.equalsverifier.EqualsVerifier; -import nl.jqno.equalsverifier.Warning; import org.junit.Assert; import org.junit.Rule; import org.junit.Test; @@ -21,21 +20,12 @@ public void testGetShortDescription() throws Exception { NextLabelCause cause = new NextLabelCause("dummylabel", build); String description = cause.getShortDescription(); Assert.assertEquals(description, "A build with label/node [dummylabel] was requested"); - - NextLabelCause causeA = new NextLabelCause(null, build); - NextLabelCause causeB = new NextLabelCause(null, build); - /* Temporary check that hashCode does not NPE on null label */ - Assert.assertEquals(causeA.hashCode(), causeB.hashCode()); - /* Temporary check that equals does not NPE on null label */ - Assert.assertTrue(causeA.equals(causeB)); } @Test public void testEqualsContract() { - EqualsVerifier.forClass(LabelParameterValue.class) - .usingGetClass() - .suppress(Warning.NONFINAL_FIELDS) - .withIgnoredFields("description", "nextLabels") - .verify(); + // The UpstreamCause base class of NextLabelCause complicates the equals contract. + // Intentionally use the simple() verifier. + EqualsVerifier.simple().forClass(NextLabelCause.class).verify(); } }