@Test
public void isReplaceToken_handlesException(@Mocked final InstanceIdentity identity) {

    new Expectations() {
        {
            priamServer.getInstanceIdentity();
            result = identity;
            identity.isReplace();
            result = new RuntimeException();
        }
    };
    Response response = resource.isReplaceToken();
    assertEquals(500, response.getStatus());
}