Skip to content

Commit 16da27f

Browse files
authored
[All] Apply checkstyle on test classes (#2783)
Co-authored-by: Julien Kronegg <julien [at] kronegg.ch>
1 parent f9656d6 commit 16da27f

File tree

26 files changed

+54
-53
lines changed

26 files changed

+54
-53
lines changed

cucumber-core/src/test/java/io/cucumber/core/eventbus/RandomUuidGeneratorTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
import java.util.UUID;
66

7-
import static org.junit.jupiter.api.Assertions.*;
7+
import static org.junit.jupiter.api.Assertions.assertNotEquals;
8+
import static org.junit.jupiter.api.Assertions.assertNotNull;
89

910
class RandomUuidGeneratorTest {
1011
@Test

cucumber-core/src/test/java/io/cucumber/core/exception/UnrecoverableExceptionsTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
import org.junit.jupiter.api.Test;
44

55
import static io.cucumber.core.exception.UnrecoverableExceptions.rethrowIfUnrecoverable;
6-
import static org.junit.jupiter.api.Assertions.*;
6+
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
7+
import static org.junit.jupiter.api.Assertions.assertThrows;
78

89
class UnrecoverableExceptionsTest {
910

cucumber-core/src/test/java/io/cucumber/core/options/RuntimeOptionsBuilderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import io.cucumber.core.eventbus.IncrementingUuidGenerator;
44
import org.junit.jupiter.api.Test;
55

6-
import static org.junit.jupiter.api.Assertions.*;
6+
import static org.junit.jupiter.api.Assertions.assertEquals;
77

88
class RuntimeOptionsBuilderTest {
99

cucumber-core/src/test/java/io/cucumber/core/options/UuidGeneratorParserTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
import org.junit.jupiter.api.Test;
88

99
import static org.hamcrest.MatcherAssert.assertThat;
10-
import static org.junit.jupiter.api.Assertions.*;
10+
import static org.junit.jupiter.api.Assertions.assertEquals;
11+
import static org.junit.jupiter.api.Assertions.assertThrows;
1112

1213
class UuidGeneratorParserTest {
1314

cucumber-core/src/test/java/io/cucumber/core/runner/CachingGlueTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@
4343
import static org.hamcrest.collection.IsIterableContainingInOrder.contains;
4444
import static org.hamcrest.core.Is.is;
4545
import static org.hamcrest.core.IsEqual.equalTo;
46-
import static org.junit.jupiter.api.Assertions.*;
46+
import static org.junit.jupiter.api.Assertions.assertAll;
47+
import static org.junit.jupiter.api.Assertions.assertEquals;
48+
import static org.junit.jupiter.api.Assertions.assertNotNull;
49+
import static org.junit.jupiter.api.Assertions.assertThrows;
50+
import static org.junit.jupiter.api.Assertions.assertTrue;
4751
import static org.mockito.Mockito.mock;
4852
import static org.mockito.Mockito.when;
4953

cucumber-core/src/test/java/io/cucumber/core/runner/HookTestStepTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
import static org.hamcrest.MatcherAssert.assertThat;
2121
import static org.hamcrest.core.Is.is;
2222
import static org.hamcrest.core.IsEqual.equalTo;
23-
import static org.junit.jupiter.api.Assertions.assertFalse;
24-
import static org.junit.jupiter.api.Assertions.assertTrue;
2523
import static org.mockito.ArgumentMatchers.isA;
2624
import static org.mockito.Mockito.inOrder;
2725
import static org.mockito.Mockito.mock;
@@ -45,7 +43,7 @@ class HookTestStepTest {
4543
private final EventBus bus = mock(EventBus.class);
4644
private final UUID testExecutionId = UUID.randomUUID();
4745
private final TestCaseState state = new TestCaseState(bus, testExecutionId, testCase);
48-
private HookTestStep step = new HookTestStep(UUID.randomUUID(), HookType.AFTER_STEP, definitionMatch);
46+
private final HookTestStep step = new HookTestStep(UUID.randomUUID(), HookType.AFTER_STEP, definitionMatch);
4947

5048
@BeforeEach
5149
void init() {

cucumber-core/src/test/java/io/cucumber/core/runner/PickleStepTestStepTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
import static org.hamcrest.core.Is.is;
3939
import static org.hamcrest.core.IsEqual.equalTo;
4040
import static org.junit.jupiter.api.Assertions.assertAll;
41-
import static org.junit.jupiter.api.Assertions.assertFalse;
42-
import static org.junit.jupiter.api.Assertions.assertTrue;
4341
import static org.mockito.ArgumentCaptor.forClass;
4442
import static org.mockito.ArgumentMatchers.any;
4543
import static org.mockito.ArgumentMatchers.argThat;

cucumber-core/src/test/java/io/cucumber/core/runner/ThrowableCollectorTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
import org.junit.jupiter.api.Test;
44
import org.opentest4j.TestAbortedException;
55

6-
import static org.junit.jupiter.api.Assertions.*;
6+
import static org.junit.jupiter.api.Assertions.assertEquals;
7+
import static org.junit.jupiter.api.Assertions.assertNull;
8+
import static org.junit.jupiter.api.Assertions.assertThrows;
79

810
class ThrowableCollectorTest {
911

cucumber-core/src/test/java/io/cucumber/core/runtime/ObjectFactoryServiceLoaderTest.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,7 @@
33
import io.cucumber.core.backend.DefaultObjectFactory;
44
import io.cucumber.core.backend.ObjectFactory;
55
import io.cucumber.core.backend.Options;
6-
import io.cucumber.core.eventbus.IncrementingUuidGenerator;
7-
import io.cucumber.core.eventbus.RandomUuidGenerator;
8-
import io.cucumber.core.eventbus.UuidGenerator;
96
import io.cucumber.core.exception.CucumberException;
10-
import org.hamcrest.Matchers;
11-
import org.junit.jupiter.api.Disabled;
127
import org.junit.jupiter.api.Test;
138

149
import java.util.function.Supplier;
@@ -21,7 +16,7 @@
2116

2217
/**
2318
* Testcases for `ObjectFactoryServiceLoader`
24-
*
19+
* <p>
2520
* <!-- @formatter:off -->
2621
* | # | object-factory property | Available services | Result |
2722
* |---|-------------------------|-------------------------------------------------------|----------------------------------------------------------------------------------|
@@ -35,7 +30,7 @@
3530
* | 8 | OtherFactory | DefaultObjectFactory | exception, class not found through SPI |
3631
* | 9 | undefined | OtherFactory | OtherFactory used |
3732
* <!-- @formatter:on -->
38-
*
33+
* <p>
3934
* Essentially this means that
4035
* * (2) Cucumber works by default
4136
* * (4) When adding a custom implementation to the class path it is used automatically

cucumber-core/src/test/java/io/cucumber/core/runtime/ServiceLoaderTestClassLoader.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@
1414

1515
/**
1616
* Testing classloader for ServiceLoader. This classloader overrides the
17-
* META-INF/services/<interface> file with a custom definition.
17+
* META-INF/services/interface-class-name file with a custom definition.
1818
*/
1919
public class ServiceLoaderTestClassLoader extends URLClassLoader {
2020
Class<?> metaInfInterface;
2121
Class<?>[] implementingClasses;
2222

2323
/**
24-
* Constructs a classloader which has no
25-
* META-INF/services/<metaInfInterface>.
24+
* Constructs a classloader which has no META-INF/services/metaInfInterface.
2625
*
2726
* @param metaInfInterface ServiceLoader interface
2827
*/
@@ -31,11 +30,10 @@ public ServiceLoaderTestClassLoader(Class<?> metaInfInterface) {
3130
}
3231

3332
/**
34-
* Constructs a fake META-INF/services/<metaInfInterface> file which
35-
* contains the provided array of classes. When the implementingClasses
36-
* array is null, the META-INF file will not be constructed. The classes
37-
* from implementingClasses are not required to implement the
38-
* metaInfInterface.
33+
* Constructs a fake META-INF/services/metaInfInterface file which contains
34+
* the provided array of classes. When the implementingClasses array is
35+
* null, the META-INF file will not be constructed. The classes from
36+
* implementingClasses are not required to implement the metaInfInterface.
3937
*
4038
* @param metaInfInterface ServiceLoader interface
4139
* @param implementingClasses potential subclasses of the ServiceLoader

0 commit comments

Comments
 (0)