@Test
public void testTokenFailure() throws Exception {

  final IOException rootCause = new IOException("netsplit!");
  when(auth.getToken(any())).thenThrow(rootCause);
  thrown.expect(ClientErrorException.class);
  thrown.expectMessage("Authentication failure: " + rootCause.getMessage());
  thrown.expectCause(is(rootCause));
  styx.triggerWorkflowInstance("foo", "bar", "baz");
}