use of io.gravitee.am.model.scim.Certificate in project gravitee-access-management by gravitee-io.
the class OrganizationUserRepositoryTest method buildUser.
private User buildUser() {
User user = new User();
String random = UUID.randomUUID().toString();
user.setReferenceType(ReferenceType.ORGANIZATION);
user.setReferenceId("organization" + random);
user.setUsername("username" + random);
user.setEmail(random + "@acme.fr");
user.setAccountLockedAt(new Date());
user.setAccountLockedUntil(new Date());
user.setAccountNonExpired(true);
user.setAccountNonLocked(true);
user.setClient("client" + random);
user.setCreatedAt(new Date());
user.setCredentialsNonExpired(true);
user.setDisplayName("display" + random);
user.setEnabled(true);
user.setExternalId("external" + random);
user.setInternal(false);
user.setLastName("last" + random);
user.setLoggedAt(new Date());
user.setFirstName("first" + random);
user.setLoginsCount(5l);
user.setNewsletter(false);
user.setNickName("nick" + random);
user.setSource("gravitee");
user.setPassword("testpassword");
Attribute attribute = new Attribute();
attribute.setPrimary(true);
attribute.setType("attrType");
attribute.setValue("val" + random);
user.setEmails(Arrays.asList(attribute));
user.setPhotos(Arrays.asList(attribute));
user.setPhoneNumbers(Arrays.asList(attribute));
user.setIms(Arrays.asList(attribute));
user.setEntitlements(Arrays.asList("ent" + random));
user.setRoles(Arrays.asList("role" + random));
user.setDynamicRoles(Arrays.asList("dynamic_role" + random));
Address addr = new Address();
addr.setCountry("fr");
user.setAddresses(Arrays.asList(addr));
Certificate certificate = new Certificate();
certificate.setValue("cert" + random);
user.setX509Certificates(Arrays.asList(certificate));
EnrolledFactor fact = new EnrolledFactor();
fact.setAppId("app" + random);
fact.setSecurity(new EnrolledFactorSecurity("a", "b", Collections.singletonMap("a", "b")));
fact.setChannel(new EnrolledFactorChannel(EnrolledFactorChannel.Type.EMAIL, "e@e"));
user.setFactors(Arrays.asList(fact));
Map<String, Object> info = new HashMap<>();
info.put(StandardClaims.EMAIL, random + "@info.acme.fr");
user.setAdditionalInformation(info);
return user;
}
use of io.gravitee.am.model.scim.Certificate in project gravitee-access-management by gravitee-io.
the class UserRepositoryTest method buildUser.
private User buildUser() {
User user = new User();
String random = UUID.randomUUID().toString();
user.setReferenceType(ReferenceType.DOMAIN);
user.setReferenceId("domain" + random);
user.setUsername("username" + random);
user.setEmail(random + "@acme.fr");
user.setAccountLockedAt(new Date());
user.setAccountLockedUntil(new Date());
user.setAccountNonExpired(true);
user.setAccountNonLocked(true);
user.setClient("client" + random);
user.setCreatedAt(new Date());
user.setMfaEnrollmentSkippedAt(new Date());
user.setCredentialsNonExpired(true);
user.setDisplayName("display" + random);
user.setEnabled(true);
user.setExternalId("external" + random);
user.setInternal(false);
user.setLastName("last" + random);
user.setLoggedAt(new Date());
user.setLastPasswordReset(new Date());
user.setFirstName("first" + random);
user.setLoginsCount(5l);
user.setNewsletter(false);
user.setNickName("nick" + random);
user.setSource("test");
Attribute attribute = new Attribute();
attribute.setPrimary(true);
attribute.setType("attrType");
attribute.setValue("val" + random);
user.setEmails(Arrays.asList(attribute));
user.setPhotos(Arrays.asList(attribute));
user.setPhoneNumbers(Arrays.asList(attribute));
user.setIms(Arrays.asList(attribute));
user.setEntitlements(Arrays.asList("ent" + random));
user.setRoles(Arrays.asList("role" + random));
user.setDynamicRoles(Arrays.asList("dynamic_role" + random));
Address addr = new Address();
addr.setCountry("fr");
user.setAddresses(Arrays.asList(addr));
Certificate certificate = new Certificate();
certificate.setValue("cert" + random);
user.setX509Certificates(Arrays.asList(certificate));
EnrolledFactor fact = new EnrolledFactor();
fact.setAppId("app" + random);
fact.setSecurity(new EnrolledFactorSecurity("a", "b", Collections.singletonMap("a", "b")));
fact.setChannel(new EnrolledFactorChannel(EnrolledFactorChannel.Type.EMAIL, "e@e"));
user.setFactors(Arrays.asList(fact));
Map<String, Object> info = new HashMap<>();
info.put(StandardClaims.EMAIL, random + "@info.acme.fr");
user.setAdditionalInformation(info);
return user;
}
Aggregations