mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
[build] Apply spotless for java formatting (#1768)
Update checkstyle config to be compatible with spotless. Co-authored-by: Austin Shalit <austinshalit@gmail.com>
This commit is contained in:
@@ -4,22 +4,21 @@
|
||||
|
||||
package edu.wpi.first.wpilibj;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.Arrays;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.junit.jupiter.api.DynamicTest;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestFactory;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.junit.jupiter.api.DynamicTest.dynamicTest;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.Arrays;
|
||||
import java.util.stream.Stream;
|
||||
import org.junit.jupiter.api.DynamicTest;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestFactory;
|
||||
|
||||
@SuppressWarnings("PMD.AbstractClassWithoutAbstractMethod")
|
||||
public abstract class UtilityClassTest<T> {
|
||||
private final Class<T> m_clazz;
|
||||
@@ -30,8 +29,7 @@ public abstract class UtilityClassTest<T> {
|
||||
|
||||
@Test
|
||||
public void singleConstructorTest() {
|
||||
assertEquals(1, m_clazz.getDeclaredConstructors().length,
|
||||
"More than one constructor defined");
|
||||
assertEquals(1, m_clazz.getDeclaredConstructors().length, "More than one constructor defined");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -52,7 +50,9 @@ public abstract class UtilityClassTest<T> {
|
||||
Stream<DynamicTest> publicMethodsStaticTestFactory() {
|
||||
return Arrays.stream(m_clazz.getDeclaredMethods())
|
||||
.filter(method -> Modifier.isPublic(method.getModifiers()))
|
||||
.map(method -> dynamicTest(method.getName(),
|
||||
() -> assertTrue(Modifier.isStatic(method.getModifiers()))));
|
||||
.map(
|
||||
method ->
|
||||
dynamicTest(
|
||||
method.getName(), () -> assertTrue(Modifier.isStatic(method.getModifiers()))));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user