@Test
public void getToken(
        @Mocked final InstanceIdentity identity, @Mocked final PriamInstance instance) {

    final String token = "myToken";
    new Expectations() {
        {
            priamServer.getInstanceIdentity();
            result = identity;
            times = 2;
            identity.getInstance();
            result = instance;
            times = 2;
            instance.getToken();
            result = token;
            times = 2;
        }
    };
    Response response = resource.getToken();
    assertEquals(200, response.getStatus());
    assertEquals(token, response.getEntity());
}