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

    final String replacedIp = "127.0.0.1";
    new Expectations() {
        {
            priamServer.getInstanceIdentity();
            result = identity;
            identity.getReplacedIp();
            result = replacedIp;
        }
    };
    Response response = resource.getReplacedIp();
    assertEquals(200, response.getStatus());
    assertEquals(replacedIp, response.getEntity());
}