@Test
public void createInstance(@Mocked final PriamInstance instance) {

    final String instanceID = "i-abc123";
    final String hostname = "dom.com";
    final String ip = "123.123.123.123";
    final String rack = "us-east-1a";
    final String token = "1234567890";
    new Expectations() {
        {
            config.getAppName();
            result = APP_NAME;
            factory.create(APP_NAME, NODE_ID, instanceID, hostname, ip, rack, null, token);
            result = instance;
            instance.getId();
            result = NODE_ID;
        }
    };
    Response response = resource.createInstance(NODE_ID, instanceID, hostname, ip, rack, token);
    assertEquals(201, response.getStatus());
    assertEquals("/" + NODE_ID, response.getMetadata().getFirst("location").toString());
}