use of edu.stanford.bmir.protege.web.shared.app.UserInSession in project webprotege by protegeproject.
the class DispatchServiceCallback_TestCase method shouldCall_handlePermissionDeniedException.
@Test
public void shouldCall_handlePermissionDeniedException() {
PermissionDeniedException exception = mock(PermissionDeniedException.class);
UserInSession userInSession = mock(UserInSession.class);
when(userInSession.isGuest()).thenReturn(false);
when(exception.getUserInSession()).thenReturn(userInSession);
callback.onFailure(exception);
verify(callback, times(1)).handlePermissionDeniedException(exception);
verify(messageDisplay, times(1)).displayPermissionDeniedErrorMessage();
}
use of edu.stanford.bmir.protege.web.shared.app.UserInSession in project webprotege by protegeproject.
the class GwtTest_UserInSessionDecoder method test_Decode.
public void test_Decode() {
UserInSessionDecoder decoder = new UserInSessionDecoder();
UserInSession userInSession = decoder.decode(new JSONObject(JsonUtils.safeEval(userInSessionJson)));
assertEquals(userInSession, EXPECTED_SESSION_DATA);
finishTest();
}
use of edu.stanford.bmir.protege.web.shared.app.UserInSession in project webprotege by protegeproject.
the class LoggedInUserManager method readUserInSession.
private void readUserInSession() {
UserInSessionDecoder decoder = new UserInSessionDecoder();
UserInSession userInSession = ClientObjectReader.create("userInSession", decoder).read();
loggedInUser.setLoggedInUser(userInSession);
}
use of edu.stanford.bmir.protege.web.shared.app.UserInSession in project webprotege by protegeproject.
the class UserInSessionFactory_TestCase method shouldProvideUserInSessionForGuestUser.
@Test
public void shouldProvideUserInSessionForGuestUser() {
UserInSession userInSession = factory.getUserInSession(UserId.getGuest());
assertThat(userInSession.getUserDetails(), is(UserDetails.getGuestUserDetails()));
assertThat(userInSession.getAllowedApplicationActions(), is(Collections.emptySet()));
}
use of edu.stanford.bmir.protege.web.shared.app.UserInSession in project webprotege by protegeproject.
the class UserInSessionFactory_TestCase method shouldProvideUserInSessionForUnknownUser.
@Test
public void shouldProvideUserInSessionForUnknownUser() {
UserInSession userInSession = factory.getUserInSession(UserId.getUserId("SomeOtherUserId"));
assertThat(userInSession.getUserDetails(), is(UserDetails.getGuestUserDetails()));
assertThat(userInSession.getAllowedApplicationActions(), is(Collections.emptySet()));
}
Aggregations