@Test
public void getInstances(
        @Mocked final PriamInstance instance1,
        @Mocked final PriamInstance instance2,
        @Mocked final PriamInstance instance3) {

    new Expectations() {
        final List<PriamInstance> instances = ImmutableList.of(instance1, instance2, instance3);
        {
            config.getAppName();
            result = APP_NAME;
            factory.getAllIds(APP_NAME);
            result = instances;
            instance1.toString();
            result = "instance1";
            instance2.toString();
            result = "instance2";
            instance3.toString();
            result = "instance3";
        }
    };
    assertEquals("instance1\ninstance2\ninstance3\n", resource.getInstances());
}