Skip to content

Commit

Permalink
Fix further Sonar findings
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianhoelzl-sap committed Mar 6, 2024
1 parent 9c25691 commit a951797
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.util.Set;
import java.util.UUID;

import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
import static org.junit.Assert.*;

/**
Expand Down Expand Up @@ -364,8 +365,6 @@ public void testGroupSettersGetters() {
Group group2 = new Group("id", "display", Group.Type.DIRECT);
assertEquals(group1, group2);
assertEquals(group2, group1);
assertEquals(group1, group1);
assertEquals(group2, group2);
assertNotEquals(null, group1);
assertNotEquals(group1, new Object());
group1.setValue(null);
Expand Down Expand Up @@ -452,14 +451,11 @@ public void testPhoneNumber() {
assertEquals("type", p1.getType());
ScimUser user = new ScimUser();
user.setPhoneNumbers(Collections.singletonList(p1));
try {

assertThatIllegalArgumentException().isThrownBy(() -> {
p1.setType(null);
user.addPhoneNumber(p1.getValue());
fail();
}catch (IllegalArgumentException ignored) {

}

});
}

@Test
Expand Down Expand Up @@ -615,7 +611,7 @@ public void testPatchUserDropNameSubAttributes() {
@Test
public void testPatchUserRejectChangingOrigin() {
patch.setOrigin("some-new-origin");
Assertions.assertThatIllegalArgumentException().isThrownBy(() -> user.patch(patch))
assertThatIllegalArgumentException().isThrownBy(() -> user.patch(patch))
.withMessage("Cannot change origin in patch of user.");
}

Expand Down

0 comments on commit a951797

Please sign in to comment.