File tree 2 files changed +13
-4
lines changed
main/java/io/securecodebox/persistence/defectdojo/model
test/java/io/securecodebox/persistence/defectdojo/model
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 {
23
23
24
24
@ Override
25
25
public boolean equalsQueryString (Map <String , Object > queryParams ) {
26
+ if (QueryParamsComparator .isNull (queryParams )) {
27
+ return false ;
28
+ }
29
+
26
30
// The user_profile endpoint does not have query parameters that's
27
31
// 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.
30
32
return true ;
31
33
}
32
34
Original file line number Diff line number Diff line change @@ -22,11 +22,18 @@ void equalsAndHashCode() {
22
22
}
23
23
24
24
@ Test
25
- void equalsQueryString_alwaysTrue () {
25
+ void equalsQueryString_alwaysTrueIfNotNullGiven () {
26
26
final var sut = UserProfile .builder ()
27
27
.build ();
28
28
29
- assertThat (sut .equalsQueryString (null ), is (true ));
30
29
assertThat (sut .equalsQueryString (Collections .emptyMap ()), is (true ));
31
30
}
31
+
32
+ @ Test
33
+ void equalsQueryString_alwaysFalseIfNull () {
34
+ final var sut = UserProfile .builder ()
35
+ .build ();
36
+
37
+ assertThat (sut .equalsQueryString (null ), is (false ));
38
+ }
32
39
}
You can’t perform that action at this time.
0 commit comments