Skip to content

Commit

Permalink
fix: add exception handling in test case #6035 (#6036)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgomer2001 authored Sep 14, 2023
1 parent ea8963c commit 32bf00f
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.jans.scim2.client.singleresource;

import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.beanutils.NestedNullException;
import io.jans.scim.model.scim2.ListResponse;
import io.jans.scim.model.scim2.fido.Fido2DeviceResource;
import io.jans.scim.model.scim2.util.IntrospectUtil;
Expand Down Expand Up @@ -84,7 +85,12 @@ public void updateWithObject() throws Exception{

//Naively compare (property-to-property) the original and new object. It's feasible since all of them are strings
for (String path : IntrospectUtil.allAttrs.get(fido2Class)){
String val=BeanUtils.getProperty(device, path);
String val;
try {
val = BeanUtils.getProperty(device, path);
} catch (NestedNullException nene) {
val = null;
}
//Exclude metas since they diverge and skip if original attribute was null (when passing null for an update, server ignores)
if (!path.startsWith("meta") && val!=null) {
assertEquals(BeanUtils.getProperty(updated, path), val);
Expand Down

0 comments on commit 32bf00f

Please sign in to comment.