Пример #1
0
 private void checkServerState(String drink, final boolean stateShouldChange) {
   try {
     Boolean result = service.checkIfDrankDrink(drink);
     assertTrue(stateShouldChange == result);
   } catch (Exception caught) {
     TestSetValidator.rethrowException(caught);
   }
 }
Пример #2
0
 public void testRpcWithoutXsrfTokenFails() throws Exception {
   try {
     service.drink("kumys");
     fail("Should've failed without XSRF token");
   } catch (Exception caught) {
     RpcTokenException e = (RpcTokenException) caught;
     assertTrue(e.getMessage().contains("XSRF token missing"));
     checkServerState("kumys", false);
   }
 }