Skip to content

Commit

Permalink
Add a testcase to reproduce #663.
Browse files Browse the repository at this point in the history
  • Loading branch information
nedtwigg committed Aug 9, 2020
1 parent d3fda7f commit 1e2d117
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,20 @@ public void order() throws Exception {
runTest();
}

@Test
public void standard() throws Exception {
writePomWithJavaSteps("<importOrder />");
runTest("java/importsorter/JavaCodeSortedImportsDefault.test");
}

private void runTest() throws Exception {
runTest("java/importsorter/JavaCodeSortedImports.test");
}

private void runTest(String expectedResource) throws Exception {
String path = "src/main/java/test.java";
setFile(path).toResource("java/importsorter/JavaCodeUnsortedImports.test");
mavenRunner().withArguments("spotless:apply").runNoError();
assertFile(path).sameAsResource("java/importsorter/JavaCodeSortedImports.test");
assertFile(path).sameAsResource(expectedResource);
}
}

0 comments on commit 1e2d117

Please sign in to comment.