Skip to content

Commit

Permalink
Do not rely on order to assert mapping toString result
Browse files Browse the repository at this point in the history
  • Loading branch information
radcortez committed Nov 7, 2023
1 parent 9977dde commit 4de00dc
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,14 @@ void generateToString() {
.build();

ToStringMapping mapping = config.getConfigMapping(ToStringMapping.class);
assertEquals("ToStringMapping{host=localhost, port=8080, aliases=[Alias{name=prod-1}, Alias{name=prod-2}]}",
mapping.toString());
String toString = mapping.toString();
assertTrue(toString.contains("ToStringMapping{"));
assertTrue(toString.contains("host=localhost"));
assertTrue(toString.contains("port=8080"));
assertTrue(toString.contains("port=8080"));
assertTrue(toString.contains("aliases=["));
assertTrue(toString.contains("Alias{name=prod-1}"));
assertTrue(toString.contains("Alias{name=prod-2}"));
}

@ConfigMapping(prefix = "server")
Expand Down

0 comments on commit 4de00dc

Please sign in to comment.