UserDetails principal = new User(USERNAME, PASSWORD, authorities);
when(securityContextUtilMock.getPrincipal()).thenReturn(principal);
UserDTO loggedInUser = controller.getLoggedInUser();
verify(securityContextUtilMock, times(1)).getPrincipal();
verifyNoMoreInteractions(securityContextUtilMock);
assertEquals(USERNAME, loggedInUser.getUsername());
assertEquals(SecurityRole.ROLE_USER, loggedInUser.getRole());
}