Skip to content

Commit f01b038

Browse files
committed
Fix tests
1 parent fc938df commit f01b038

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

plugin-maven/src/test/java/com/diffplug/spotless/maven/MavenIntegrationHarness.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ protected void writePomWithMarkdownSteps(String... steps) throws IOException {
156156
writePom(groupWithSteps("markdown", including("**/*.md"), steps));
157157
}
158158

159+
protected void writePomWithJsonSteps(String... steps) throws IOException {
160+
writePom(groupWithSteps("json", including("**/*.json"), steps));
161+
}
162+
159163
protected void writePom(String... configuration) throws IOException {
160164
writePom(null, configuration, null);
161165
}

plugin-maven/src/test/java/com/diffplug/spotless/maven/json/JsonTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@
2222
public class JsonTest extends MavenIntegrationHarness {
2323
@Test
2424
public void testFormatJson_WithSimple_defaultConfig() throws Exception {
25-
writePomWithPomSteps("<json><simple/></json>");
25+
writePomWithJsonSteps("<json><simple/></json>");
2626

27-
setFile("json_test.json").toResource("json/json_dirty.json");
27+
setFile("json_test.json").toResource("json/sortByKeysBefore.json");
2828
mavenRunner().withArguments("spotless:apply").runNoError().error();
29-
assertFile("json_test.json").sameAsResource("json/json_clean_default.json");
29+
assertFile("json_test.json").sameAsResource("json/sortByKeysAfterDisabled.json");
3030
}
3131

3232
@Test
3333
public void testFormatJson_WithGson_defaultConfig() throws Exception {
34-
writePomWithPomSteps("<json><gson/></json>");
34+
writePomWithJsonSteps("<json><gson/></json>");
3535

36-
setFile("json_test.json").toResource("json/json_dirty.json");
36+
setFile("json_test.json").toResource("json/sortByKeysBefore.json");
3737
mavenRunner().withArguments("spotless:apply").runNoError().error();
38-
assertFile("json_test.json").sameAsResource("json/json_clean_default.json");
38+
assertFile("json_test.json").sameAsResource("json/sortByKeysAfterDisabled.json");
3939
}
4040
}

0 commit comments

Comments
 (0)