Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test sonar #2654

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
01380bd
Add flyway migration script for adding "alias_id" and "alias_zid" col…
adrianhoelzl-sap Dec 6, 2023
b67d39c
Add aliasId and aliasZid properties to IdentityProvider class
adrianhoelzl-sap Dec 7, 2023
a0cfe80
Fix IdentityProviderEndpointDocs
adrianhoelzl-sap Dec 11, 2023
c9f4a21
Add migration scripts for MySQL and HSQL
adrianhoelzl-sap Dec 12, 2023
7d7aef5
Fix queries creating or modifying identity providers
adrianhoelzl-sap Dec 12, 2023
e150510
Fix optional constraints in IdP endpoint docs
adrianhoelzl-sap Dec 12, 2023
06a3081
Fix row mapper for update in JdbcIdentityProviderProvisioning
adrianhoelzl-sap Dec 12, 2023
b6dca9d
Fix field definitions for alias_id and alias_zid in IdentityProviderE…
adrianhoelzl-sap Dec 12, 2023
6a8ef06
Improve comments in JdbcIdentityProviderProvisioning
adrianhoelzl-sap Dec 13, 2023
6522e82
Add tests for IdP creation and update affecting alias properties
adrianhoelzl-sap Dec 18, 2023
9f19be9
Add logic for mirroring IdPs from/to custom zones
adrianhoelzl-sap Dec 18, 2023
d6da7c5
Use static import of StringUtils.hasText
adrianhoelzl-sap Dec 18, 2023
0c64c03
Add token format parameter to MockMvcUtils.getUserOAuthAccessTokenAut…
adrianhoelzl-sap Dec 18, 2023
edf2caa
Move tests regarding alias properties of IdP endpoints to separate class
adrianhoelzl-sap Dec 18, 2023
4081553
Revert changes to IdentityProviderEndpointsMockMvcTests
adrianhoelzl-sap Dec 18, 2023
cb3788d
Remove comment
adrianhoelzl-sap Dec 18, 2023
8aba009
Add tests for deletion operation
adrianhoelzl-sap Dec 20, 2023
4dd7c95
Consider mirrored IdPs in IdP status update endpoint
adrianhoelzl-sap Dec 20, 2023
12bd9a7
Fix unit tests
adrianhoelzl-sap Dec 20, 2023
86c2431
Add creation of new mirrored IdP if aliasId is set, but the reference…
adrianhoelzl-sap Dec 20, 2023
9ce3ebe
Fix IdentityProviderEndpointsAliasMockMvcTests
adrianhoelzl-sap Dec 20, 2023
94cd995
Simplify validation of alias properties
adrianhoelzl-sap Dec 20, 2023
1d2e9ae
Add tests for update status calls involving mirrored IdPs
adrianhoelzl-sap Dec 20, 2023
63472c4
Add tests for mirrored IdP being created if referenced, but not present
adrianhoelzl-sap Dec 20, 2023
bf5c42c
Add deletion of mirrored IdPs when Identity Zone is deleted
adrianhoelzl-sap Dec 20, 2023
d985b8f
Add test for mirrored IdPs being removed when zones are deleted
adrianhoelzl-sap Dec 21, 2023
05acd82
Add tests for transaction handling
adrianhoelzl-sap Dec 21, 2023
7cde84c
Add caching of access tokens in IdentityProviderEndpointsAliasMockMvc…
adrianhoelzl-sap Dec 21, 2023
9106d32
Fix Sonar finding
adrianhoelzl-sap Dec 21, 2023
d10465f
Fix Sonar code smells
adrianhoelzl-sap Dec 21, 2023
49e025f
Fix Sonar code smells
adrianhoelzl-sap Dec 21, 2023
2fcdfbd
Merge remote-tracking branch 'origin/develop' into feature/alias-id-a…
strehle Dec 21, 2023
ab0729d
test sonar
strehle Dec 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ public class IdentityProvider<T extends AbstractIdentityProviderDefinition> {
public static final String FIELD_IDENTITY_ZONE_ID = "identityZoneId";
public static final String FIELD_CONFIG = "config";
public static final String FIELD_TYPE = "type";
public static final String FIELD_ALIAS_ID = "alias_id";
public static final String FIELD_ALIAS_ZID = "alias_zid";
//see deserializer at the bottom

private String id;
@NotNull
private String originKey;
Expand All @@ -71,7 +74,10 @@ public class IdentityProvider<T extends AbstractIdentityProviderDefinition> {
private Date lastModified = new Date();
private boolean active = true;
private String identityZoneId;

@JsonProperty("alias_id")
private String aliasId;
@JsonProperty("alias_zid")
private String aliasZid;
public Date getCreated() {
return created;
}
Expand Down Expand Up @@ -197,6 +203,24 @@ public IdentityProvider setIdentityZoneId(String identityZoneId) {
return this;
}

public String getAliasId() {
return aliasId;
}

public IdentityProvider<T> setAliasId(String aliasId) {
this.aliasId = aliasId;
return this;
}

public String getAliasZid() {
return aliasZid;
}

public IdentityProvider<T> setAliasZid(String aliasZid) {
this.aliasZid = aliasZid;
return this;
}

@Override
public int hashCode() {
final int prime = 31;
Expand All @@ -208,6 +232,8 @@ public int hashCode() {
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((originKey == null) ? 0 : originKey.hashCode());
result = prime * result + ((type == null) ? 0 : type.hashCode());
result = prime * result + ((aliasId == null) ? 0 : aliasId.hashCode());
result = prime * result + ((aliasZid == null) ? 0 : aliasZid.hashCode());
result = prime * result + version;
return result;
}
Expand Down Expand Up @@ -256,6 +282,20 @@ public boolean equals(Object obj) {
return false;
} else if (!type.equals(other.type))
return false;
if (aliasId == null) {
if (other.aliasId != null) {
return false;
}
} else if (!aliasId.equals(other.aliasId)) {
return false;
}
if (aliasZid == null) {
if (other.aliasZid != null) {
return false;
}
} else if (!aliasZid.equals(other.aliasZid)) {
return false;
}
if (version != other.version)
return false;
return true;
Expand All @@ -269,6 +309,21 @@ public String toString() {
sb.append(", name='").append(name).append('\'');
sb.append(", type='").append(type).append('\'');
sb.append(", active=").append(active);

sb.append(", aliasId=");
if (aliasId != null) {
sb.append('\'').append(aliasId).append('\'');
} else {
sb.append("null");
}

sb.append(", aliasZid=");
if (aliasZid != null) {
sb.append('\'').append(aliasZid).append('\'');
} else {
sb.append("null");
}

sb.append('}');
return sb.toString();
}
Expand Down Expand Up @@ -304,6 +359,8 @@ public void serialize(IdentityProvider value, JsonGenerator gen, SerializerProvi
writeDateField(FIELD_LAST_MODIFIED, value.getLastModified(), gen);
gen.writeBooleanField(FIELD_ACTIVE, value.isActive());
gen.writeStringField(FIELD_IDENTITY_ZONE_ID, value.getIdentityZoneId());
gen.writeStringField(FIELD_ALIAS_ID, value.getAliasId());
gen.writeStringField(FIELD_ALIAS_ZID, value.getAliasZid());
gen.writeEndObject();
}

Expand Down Expand Up @@ -369,6 +426,8 @@ public IdentityProvider deserialize(JsonParser jp, DeserializationContext ctxt)
result.setLastModified(getNodeAsDate(node, FIELD_LAST_MODIFIED));
result.setActive(getNodeAsBoolean(node, FIELD_ACTIVE, true));
result.setIdentityZoneId(getNodeAsString(node, FIELD_IDENTITY_ZONE_ID, null));
result.setAliasId(getNodeAsString(node, FIELD_ALIAS_ID, null));
result.setAliasZid(getNodeAsString(node, FIELD_ALIAS_ZID, null));
return result;
}

Expand Down
Loading