예제 #1
0
 @Test
 public void shouldLoginAsAdmin() {
   final RestTestUser admin = AuthEndPointsHandler.loginAsAdmin();
   boolean userIsAdmin = UserEndPointsHandler.isUserAdmin(admin.getUserId());
   assertThat(userIsAdmin, is(Boolean.TRUE));
   AdminCategoryEndPointsHandler.getItems();
 }
예제 #2
0
 @Test
 public void shouldLogin() {
   UserRegData anotherUserData = RandomUtils.randomUser();
   UserDTO anotherUser = AuthEndPointsHandler.registerNewUser(anotherUserData);
   AuthResponse authResponse =
       AuthEndPointsHandler.login(anotherUserData.getLogin(), anotherUserData.getPassword());
   boolean userIsAdmin =
       UserEndPointsHandler.isUserAdmin(AuthEndPointsHandler.readUserId(authResponse));
   assertThat(userIsAdmin, is(Boolean.FALSE));
 }