use of se.inera.intyg.infra.security.common.model.RequestOrigin in project webcert by sklintyg.
the class FragaSvarModuleApiControllerTest method createPrivilege.
protected Privilege createPrivilege(String privilege) {
Privilege priv = new Privilege();
priv.setName(privilege);
RequestOrigin requestOrigin = new RequestOrigin();
requestOrigin.setName(UserOriginType.UTHOPP.name());
requestOrigin.setIntygstyper(Arrays.asList(FK7263));
priv.setRequestOrigins(Arrays.asList(requestOrigin));
priv.setIntygstyper(Arrays.asList(FK7263));
return priv;
}
use of se.inera.intyg.infra.security.common.model.RequestOrigin in project webcert by sklintyg.
the class IntygModuleApiControllerTest method addPrivileges.
private void addPrivileges(WebCertUser user, String intygType, String... privileges) {
user.setAuthorities(new HashMap<>());
Privilege privilege = new Privilege();
privilege.setIntygstyper(Arrays.asList(intygType));
RequestOrigin requestOrigin = new RequestOrigin();
requestOrigin.setName("NORMAL");
requestOrigin.setIntygstyper(privilege.getIntygstyper());
privilege.setRequestOrigins(Arrays.asList(requestOrigin));
for (String privilegeString : privileges) {
user.getAuthorities().put(privilegeString, privilege);
}
}
use of se.inera.intyg.infra.security.common.model.RequestOrigin in project webcert by sklintyg.
the class IntygModuleApiControllerTest method setupUser.
private void setupUser(String privilegeString, String intygType, boolean coherentJournaling, boolean copyOk, String... features) {
WebCertUser user = new WebCertUser();
user.setAuthorities(new HashMap<>());
addFeatures(user, intygType, features);
user.setParameters(new IntegrationParameters(null, null, null, null, null, null, null, null, null, coherentJournaling, false, false, copyOk));
Privilege privilege = new Privilege();
privilege.setIntygstyper(Arrays.asList(intygType));
RequestOrigin requestOrigin = new RequestOrigin();
requestOrigin.setName("NORMAL");
requestOrigin.setIntygstyper(privilege.getIntygstyper());
privilege.setRequestOrigins(Arrays.asList(requestOrigin));
user.getAuthorities().put(privilegeString, privilege);
user.setOrigin("NORMAL");
when(webcertUserService.getUser()).thenReturn(user);
}
use of se.inera.intyg.infra.security.common.model.RequestOrigin in project webcert by sklintyg.
the class UtkastModuleApiControllerTest method setupUser.
private void setupUser(String privilegeString, String intygType, boolean coherentJournaling, String... features) {
WebCertUser user = new WebCertUser();
user.setAuthorities(new HashMap<>());
user.setFeatures(Stream.of(features).collect(Collectors.toMap(Function.identity(), s -> {
Feature feature = new Feature();
feature.setName(s);
feature.setIntygstyper(Arrays.asList(intygType));
return feature;
})));
user.setParameters(new IntegrationParameters("", "", "", "", "", "", "", "", "", coherentJournaling, false, false, true));
Privilege privilege = new Privilege();
privilege.setIntygstyper(Arrays.asList(intygType));
RequestOrigin requestOrigin = new RequestOrigin();
requestOrigin.setName("NORMAL");
requestOrigin.setIntygstyper(privilege.getIntygstyper());
privilege.setRequestOrigins(Arrays.asList(requestOrigin));
user.getAuthorities().put(privilegeString, privilege);
user.setOrigin("NORMAL");
when(webcertUserService.getUser()).thenReturn(user);
}
use of se.inera.intyg.infra.security.common.model.RequestOrigin in project webcert by sklintyg.
the class IntygIntegrationServiceImplTest method createRequestOrigin.
private RequestOrigin createRequestOrigin(String name, List<String> intygstyper) {
RequestOrigin o = new RequestOrigin();
o.setName(name);
o.setIntygstyper(intygstyper);
return o;
}
Aggregations