use of se.inera.intyg.infra.security.common.model.Privilege in project webcert by sklintyg.
the class BaseCreateDraftCertificateValidatorTest method createPrivilege.
protected Privilege createPrivilege(String privilege, List<String> intygstyper) {
Privilege priv = new Privilege();
priv.setName(privilege);
RequestOrigin requestOrigin = new RequestOrigin();
requestOrigin.setName(UserOriginType.DJUPINTEGRATION.name());
requestOrigin.setIntygstyper(intygstyper);
priv.setRequestOrigins(Arrays.asList(requestOrigin));
priv.setIntygstyper(intygstyper);
return priv;
}
use of se.inera.intyg.infra.security.common.model.Privilege in project webcert by sklintyg.
the class AuthoritiesValidatorTest method createPrivilege.
private Privilege createPrivilege(String name, List<String> intygsTyper, List<RequestOrigin> requestOrigins) {
Privilege p = new Privilege();
p.setName(name);
p.setIntygstyper(intygsTyper);
p.setRequestOrigins(requestOrigins);
return p;
}
use of se.inera.intyg.infra.security.common.model.Privilege in project webcert by sklintyg.
the class AuthoritiesValidatorTest method createUser.
private WebCertUser createUser(String roleName, Privilege p, Map<String, Feature> features, String origin) {
WebCertUser user = new WebCertUser();
HashMap<String, Privilege> pMap = new HashMap<>();
pMap.put(p.getName(), p);
user.setAuthorities(pMap);
user.setOrigin(origin);
user.setFeatures(features);
HashMap<String, Role> rMap = new HashMap<>();
Role role = new Role();
role.setName(roleName);
rMap.put(roleName, role);
user.setRoles(rMap);
return user;
}
use of se.inera.intyg.infra.security.common.model.Privilege in project webcert by sklintyg.
the class SecurityConfigurationLoaderTest method loadConfigurationAndAssertTypeOfObjects.
@Test
public void loadConfigurationAndAssertTypeOfObjects() {
AuthoritiesConfiguration configuration = loader.getAuthoritiesConfiguration();
assertEquals(4, configuration.getRequestOrigins().size());
assertEquals(9, configuration.getPrivileges().size());
assertEquals(4, configuration.getRoles().size());
assertEquals(2, configuration.getTitles().size());
assertEquals(4, configuration.getTitleCodes().size());
// Assert that lists are of specific types
try {
List<RequestOrigin> requestOrigins = (List<RequestOrigin>) configuration.getRequestOrigins();
List<Privilege> privileges = (List<Privilege>) configuration.getPrivileges();
List<Role> roles = (List<Role>) configuration.getRoles();
List<Title> titles = (List<Title>) configuration.getTitles();
List<TitleCode> titleCodes = (List<TitleCode>) configuration.getTitleCodes();
} catch (Exception e) {
fail(e.getMessage());
}
}
use of se.inera.intyg.infra.security.common.model.Privilege in project webcert by sklintyg.
the class TakServiceImplTest method createPrivilege.
private Privilege createPrivilege(String name, List<String> intygsTyper, List<RequestOrigin> requestOrigins) {
Privilege p = new Privilege();
p.setName(name);
p.setIntygstyper(intygsTyper);
p.setRequestOrigins(requestOrigins);
return p;
}
Aggregations