Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
jay-hodgson committed Nov 25, 2024
1 parent 5155e5c commit ecac17c
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -346,14 +346,25 @@ public void testClear() {
}

@Test
public void testShow403() {
public void testShow403LoggedIn() {
when(mockAuthenticationController.isLoggedIn()).thenReturn(true);
entityPresenter.setEntityId("123");
entityPresenter.show403();
verify(mockSynAlert).show403(any(), any());
verify(mockView).setEntityPageTopVisible(false);
verify(mockView).setOpenTeamInvitesVisible(true);
}

@Test
public void testShow403Anonymous() {
when(mockAuthenticationController.isLoggedIn()).thenReturn(false);
entityPresenter.setEntityId("123");
entityPresenter.show403();
verify(mockSynAlert).show403(any(), any());
verify(mockView).setEntityPageTopVisible(false);
verify(mockView, never()).setOpenTeamInvitesVisible(anyBoolean());
}

@Test
public void testEntityUpdatedHandlerWithoutId() {
QueryKey mockQueryKey = mock(QueryKey.class);
Expand Down

0 comments on commit ecac17c

Please sign in to comment.