Enforces static imports for JUnit 4 assertions and assumptions

This commit configures Checkstyle to enforces static imports for JUnit 4
assertions and assumptions.

See gh-22932
This commit is contained in:
Sam Brannen
2019-05-12 15:13:07 +02:00
parent deecab6311
commit 73dbd06361
16 changed files with 56 additions and 53 deletions

View File

@@ -19,7 +19,6 @@ package org.springframework.oxm.jibx;
import java.io.StringWriter;
import javax.xml.transform.stream.StreamResult;
import org.junit.Assume;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -28,6 +27,7 @@ import org.springframework.oxm.AbstractMarshallerTests;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;
import static org.xmlunit.matchers.CompareMatcher.isSimilarTo;
/**
@@ -43,7 +43,7 @@ public class JibxMarshallerTests extends AbstractMarshallerTests<JibxMarshaller>
@BeforeClass
public static void compilerAssumptions() {
// JiBX compiler is currently not compatible with JDK 9
Assume.assumeTrue(System.getProperty("java.version").startsWith("1.8."));
assumeTrue(System.getProperty("java.version").startsWith("1.8."));
}

View File

@@ -19,7 +19,6 @@ package org.springframework.oxm.jibx;
import java.io.ByteArrayInputStream;
import javax.xml.transform.stream.StreamSource;
import org.junit.Assume;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -27,6 +26,7 @@ import org.springframework.oxm.AbstractUnmarshallerTests;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assume.assumeTrue;
/**
* NOTE: These tests fail under Eclipse/IDEA because JiBX binding does
@@ -46,7 +46,7 @@ public class JibxUnmarshallerTests extends AbstractUnmarshallerTests<JibxMarshal
@BeforeClass
public static void compilerAssumptions() {
// JiBX compiler is currently not compatible with JDK 9
Assume.assumeTrue(System.getProperty("java.version").startsWith("1.8."));
assumeTrue(System.getProperty("java.version").startsWith("1.8."));
}