Search in sources :

Example 16 with WebCertUser

use of se.inera.intyg.webcert.web.service.user.dto.WebCertUser in project webcert by sklintyg.

the class AuthoritiesValidatorTest method testMustHavePrevilegeFails.

@Test
public void testMustHavePrevilegeFails() {
    WebCertUser user = createDefaultUser();
    thrown.expect(AuthoritiesException.class);
    validator.given(user).privilege("p2").orThrow();
}
Also used : WebCertUser(se.inera.intyg.webcert.web.service.user.dto.WebCertUser) Test(org.junit.Test)

Example 17 with WebCertUser

use of se.inera.intyg.webcert.web.service.user.dto.WebCertUser in project webcert by sklintyg.

the class AuthoritiesValidatorTest method testMustHavePrevilegeForRequestOrigin.

@Test
public void testMustHavePrevilegeForRequestOrigin() {
    WebCertUser user = createDefaultUser();
    assertTrue(validator.given(user).privilege("p1").isVerified());
}
Also used : WebCertUser(se.inera.intyg.webcert.web.service.user.dto.WebCertUser) Test(org.junit.Test)

Example 18 with WebCertUser

use of se.inera.intyg.webcert.web.service.user.dto.WebCertUser in project webcert by sklintyg.

the class AuthoritiesValidatorTest method testAllTogether.

@Test
public void testAllTogether() {
    WebCertUser user = createDefaultUser();
    assertTrue(validator.given(user, "fk7263").features(AuthoritiesConstants.FEATURE_HANTERA_INTYGSUTKAST).notFeatures(AuthoritiesConstants.FEATURE_ARBETSGIVARUTSKRIFT).roles(AuthoritiesConstants.ROLE_LAKARE).notRoles("dummy_role").origins(UserOriginType.NORMAL).notOrigins(UserOriginType.DJUPINTEGRATION).privilege("p1").notPrivilege("dummy_privilege").isVerified());
}
Also used : WebCertUser(se.inera.intyg.webcert.web.service.user.dto.WebCertUser) Test(org.junit.Test)

Example 19 with WebCertUser

use of se.inera.intyg.webcert.web.service.user.dto.WebCertUser in project webcert by sklintyg.

the class AuthoritiesValidatorTest method testMustHaveRole.

@Test
public void testMustHaveRole() {
    WebCertUser user = createDefaultUser();
    assertTrue(validator.given(user).roles(AuthoritiesConstants.ROLE_LAKARE).isVerified());
}
Also used : WebCertUser(se.inera.intyg.webcert.web.service.user.dto.WebCertUser) Test(org.junit.Test)

Example 20 with WebCertUser

use of se.inera.intyg.webcert.web.service.user.dto.WebCertUser in project webcert by sklintyg.

the class AuthoritiesValidatorTest method testMustHavePrevilegeIntygsTypFails.

@Test
public void testMustHavePrevilegeIntygsTypFails() {
    WebCertUser user = createDefaultUser();
    thrown.expect(AuthoritiesException.class);
    validator.given(user, "ts-diabetes").privilege("p1").orThrow();
}
Also used : WebCertUser(se.inera.intyg.webcert.web.service.user.dto.WebCertUser) Test(org.junit.Test)

Aggregations

WebCertUser (se.inera.intyg.webcert.web.service.user.dto.WebCertUser)217 Test (org.junit.Test)123 IntegrationParameters (se.inera.intyg.webcert.web.web.controller.integration.dto.IntegrationParameters)32 Utkast (se.inera.intyg.webcert.persistence.utkast.model.Utkast)31 Personnummer (se.inera.intyg.schemas.contract.Personnummer)24 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)23 WebCertServiceException (se.inera.intyg.webcert.common.service.exception.WebCertServiceException)23 Role (se.inera.intyg.infra.security.common.model.Role)18 HoSPersonal (se.inera.intyg.common.support.model.common.internal.HoSPersonal)16 Arende (se.inera.intyg.webcert.persistence.arende.model.Arende)15 CopyIntygRequest (se.inera.intyg.webcert.web.web.controller.api.dto.CopyIntygRequest)15 Utlatande (se.inera.intyg.common.support.model.common.internal.Utlatande)14 Vardenhet (se.inera.intyg.infra.integration.hsa.model.Vardenhet)14 CopyUtkastBuilderResponse (se.inera.intyg.webcert.web.service.utkast.dto.CopyUtkastBuilderResponse)14 Vardgivare (se.inera.intyg.infra.integration.hsa.model.Vardgivare)13 Feature (se.inera.intyg.infra.security.common.model.Feature)13 HashMap (java.util.HashMap)12 MedicinsktArende (se.inera.intyg.webcert.persistence.arende.model.MedicinsktArende)12 Transactional (org.springframework.transaction.annotation.Transactional)11 Path (javax.ws.rs.Path)10