File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
main/java/io/securecodebox/persistence/defectdojo/model
test/java/io/securecodebox/persistence/defectdojo/model Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -23,10 +23,12 @@ public final class UserProfile implements Model {
2323
2424 @ Override
2525 public boolean equalsQueryString (Map <String , Object > queryParams ) {
26+ if (QueryParamsComparator .isNull (queryParams )) {
27+ return false ;
28+ }
29+
2630 // The user_profile endpoint does not have query parameters that's
2731 // why this function will just return true.
28- // TODO: All other implementations return false if null is given for queryParams.
29- // We should consider to change this API according to that.
3032 return true ;
3133 }
3234
Original file line number Diff line number Diff line change @@ -22,11 +22,18 @@ void equalsAndHashCode() {
2222 }
2323
2424 @ Test
25- void equalsQueryString_alwaysTrue () {
25+ void equalsQueryString_alwaysTrueIfNotNullGiven () {
2626 final var sut = UserProfile .builder ()
2727 .build ();
2828
29- assertThat (sut .equalsQueryString (null ), is (true ));
3029 assertThat (sut .equalsQueryString (Collections .emptyMap ()), is (true ));
3130 }
31+
32+ @ Test
33+ void equalsQueryString_alwaysFalseIfNull () {
34+ final var sut = UserProfile .builder ()
35+ .build ();
36+
37+ assertThat (sut .equalsQueryString (null ), is (false ));
38+ }
3239}
You can’t perform that action at this time.
0 commit comments