Skip to content

Commit 4775485

Browse files
committed
Polish GroovyGradleExtensionTest
1 parent 53fe1e0 commit 4775485

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

plugin-gradle/src/test/java/com/diffplug/gradle/spotless/GroovyGradleExtensionTest.java

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2021 DiffPlug
2+
* Copyright 2016-2023 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,24 +17,20 @@
1717

1818
import java.io.IOException;
1919

20-
import org.junit.jupiter.api.Test;
20+
import org.junit.jupiter.params.ParameterizedTest;
21+
import org.junit.jupiter.params.provider.ValueSource;
2122

2223
import com.diffplug.common.base.StringPrinter;
2324

24-
class GroovyGradleExtensionTest extends GradleIntegrationHarness {
25+
/**
26+
* We test GroovyGradleExtension only behaviors here.
27+
*/
28+
class GroovyGradleExtensionTest extends GroovyExtensionTest {
2529
private static final String HEADER = "//My tests header";
2630

27-
@Test
28-
void defaultTarget() throws IOException {
29-
testTarget(true);
30-
}
31-
32-
@Test
33-
void customTarget() throws IOException {
34-
testTarget(false);
35-
}
36-
37-
private void testTarget(boolean useDefaultTarget) throws IOException {
31+
@ParameterizedTest
32+
@ValueSource(booleans = {true, false})
33+
void testTarget(boolean useDefaultTarget) throws IOException {
3834
String target = useDefaultTarget ? "" : "target 'other.gradle'";
3935
String buildContent = StringPrinter.buildStringFromLines(
4036
"plugins {",

0 commit comments

Comments
 (0)