Skip to content

Commit

Permalink
fix(jans-auth-server): tests corrections
Browse files Browse the repository at this point in the history
* feat(jans-auth): log current folder in UserServiceTest test

Signed-off-by: Yuriy Movchan <[email protected]>

* feat(jans-auth): detect if custom attribute value is array

Signed-off-by: Yuriy Movchan <[email protected]>

---------

Signed-off-by: Yuriy Movchan <[email protected]>
  • Loading branch information
yurem authored Jan 17, 2025
1 parent 4f44337 commit ef8a07a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ public void findUserAfterAddAuthenticator() {
assertNotNull(user.getAuthenticator());
assertNotNull(user.getAuthenticator().getAuthenticators());
assertEquals(user.getAuthenticator().getAuthenticators().size(), 1);
assertEquals(userAuthenticatorService.getUserAuthenticatorsByType(user, "type1"), Arrays.asList(new UserAuthenticator("id2", "type2")));
assertEquals(userAuthenticatorService.getUserAuthenticatorsByType(user, "type2"), Arrays.asList(new UserAuthenticator("id2", "type2")));

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
Expand Down Expand Up @@ -55,7 +56,11 @@ public Object getValue() {

public void setValue(Object value) {
this.values = new ArrayList<>();
this.values.add(value);
if (value instanceof List) {
this.values.addAll((Collection<? extends Object>) value);
} else {
this.values.add(value);
}
this.multiValued = false;
}

Expand Down

0 comments on commit ef8a07a

Please sign in to comment.