use of edu.stanford.bmir.protege.web.server.dispatch.RequestValidationResult in project webprotege by protegeproject.
the class GetApplicationPreferencesActionHandler_TestCase method shouldCheckForPermission.
@Test
public void shouldCheckForPermission() {
RequestValidator validator = handler.getRequestValidator(action, requestContext);
RequestValidationResult result = validator.validateAction();
assertThat(result.isInvalid(), is(true));
verify(accessManager, times(1)).hasPermission(forUser(userId), ApplicationResource.get(), EDIT_APPLICATION_SETTINGS.getActionId());
}
use of edu.stanford.bmir.protege.web.server.dispatch.RequestValidationResult in project webprotege by protegeproject.
the class UserIsSignedInValidator_TestCase method shouldNoValidateUserThatIsGuest.
@Test
public void shouldNoValidateUserThatIsGuest() {
when(userId.isGuest()).thenReturn(true);
RequestValidationResult result = validator.validateAction();
assertThat(result.isValid(), is(false));
}
use of edu.stanford.bmir.protege.web.server.dispatch.RequestValidationResult in project webprotege by protegeproject.
the class CreateNewProjectActionHandler_TestCase method shouldNotAllowGuestsToCreateProjects.
@Test
public void shouldNotAllowGuestsToCreateProjects() {
when(userId.isGuest()).thenReturn(true);
CreateNewProjectAction action = new CreateNewProjectAction(newProjectSettings);
RequestValidator validator = handler.getRequestValidator(action, requestContext);
RequestValidationResult validationResult = validator.validateAction();
assertThat(validationResult.isValid(), is(false));
}
use of edu.stanford.bmir.protege.web.server.dispatch.RequestValidationResult in project webprotege by protegeproject.
the class UserIsSignedInValidator_TestCase method shouldValidateUserThatIsNotGuest.
@Test
public void shouldValidateUserThatIsNotGuest() {
when(userId.isGuest()).thenReturn(false);
RequestValidationResult result = validator.validateAction();
assertThat(result.isValid(), is(true));
}
Aggregations