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();
}
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());
}
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());
}
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());
}
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();
}
Aggregations