Skip to content

Commit

Permalink
Exempt @TestPropertySource#locations/value from being sorted.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bastien Diederichs committed Aug 19, 2022
1 parent 9ab5bbe commit cff1ed2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ public final class LexicographicalAnnotationAttributeListing extends BugChecker
"com.fasterxml.jackson.annotation.JsonPropertyOrder#value",
"io.swagger.annotations.ApiImplicitParams#value",
"io.swagger.v3.oas.annotations.Parameters#value",
"javax.xml.bind.annotation.XmlType#propOrder");
"javax.xml.bind.annotation.XmlType#propOrder",
"org.springframework.test.context.TestPropertySource#locations",
"org.springframework.test.context.TestPropertySource#value");
private static final String FLAG_PREFIX = "LexicographicalAnnotationAttributeListing:";
private static final String INCLUDED_ANNOTATIONS_FLAG = FLAG_PREFIX + "Includes";
private static final String EXCLUDED_ANNOTATIONS_FLAG = FLAG_PREFIX + "Excludes";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ void identification() {
"import io.swagger.v3.oas.annotations.Parameters;",
"import java.math.RoundingMode;",
"import javax.xml.bind.annotation.XmlType;",
"import org.springframework.test.context.TestPropertySource;",
"",
"interface A {",
" @interface Foo {",
Expand Down Expand Up @@ -144,7 +145,13 @@ void identification() {
" A secondEndpoint();",
"",
" @XmlType(propOrder = {\"field2\", \"field1\"})",
" class Dummy {}",
" class FirstDummy {}",
"",
" @TestPropertySource(locations = {\"field2\", \"field1\"})",
" class SecondDummy {}",
"",
" @TestPropertySource({\"field2\", \"field1\"})",
" class ThirdDummy {}",
"}")
.doTest();
}
Expand Down

0 comments on commit cff1ed2

Please sign in to comment.