@Test
public void setReplacedIp() {

    new Expectations() {
        {
            priamServer.getInstanceIdentity();
            result = instanceIdentity;
        }
    };
    Response response = resource.setReplacedIp("127.0.0.1");
    assertEquals(200, response.getStatus());
    assertEquals("127.0.0.1", instanceIdentity.getReplacedIp());
    assertTrue(instanceIdentity.isReplace());
    response = resource.setReplacedIp(null);
    assertEquals(400, response.getStatus());
}