private void checkServerState(String drink, final boolean stateShouldChange) { try { Boolean result = service.checkIfDrankDrink(drink); assertTrue(stateShouldChange == result); } catch (Exception caught) { TestSetValidator.rethrowException(caught); } }
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); } }