Skip to content

Commit

Permalink
fix Sonar issues
Browse files Browse the repository at this point in the history
  • Loading branch information
klaus-sap committed Jan 24, 2024
1 parent 60b56d4 commit 7ae6a2f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,8 @@ private boolean isCheckOriginEnabled(String zoneId) {

private void checkOrigin(String origin, String zoneId) {
Integer count = jdbcTemplate.queryForObject("select count(*) from identity_provider where origin_key=? and identity_zone_id=? ", Integer.class, origin, zoneId);
if (count == 0) {
int c = (count == null) ? 0 : count;
if (c == 0) {
throw new InvalidScimResourceException("Invalid origin " + origin + " in Identity Zone " + zoneId);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1086,9 +1086,9 @@ void canCreateUserWithValidOrigin() {
scimUser.setEmails(Collections.singletonList(email));
scimUser.setPassword(randomString());
scimUser.setOrigin(validOrigin);
idzManager.getCurrentIdentityZone().getConfig().getUserConfig().setCheckOriginEnabled(true);
try {
idzManager.getCurrentIdentityZone().getConfig().getUserConfig().setCheckOriginEnabled(true);
scimUser = jdbcScimUserProvisioning.create(scimUser, currentIdentityZoneId);
jdbcScimUserProvisioning.create(scimUser, currentIdentityZoneId);
} catch (InvalidScimResourceException e) {
fail("Can't create user with valid origin when origin is checked");
} finally {
Expand Down

0 comments on commit 7ae6a2f

Please sign in to comment.