@Test
public void test_doAction_withChildResource() throws RepositoryException, PersistenceException {

    when(resourceResolver.getResource(eq(resource), eq(CHILD1))).thenReturn(mock(Resource.class));
    when(resourceResolver.getResource(eq(resource), eq(CHILD2))).thenReturn(null);
    when(resourceResolver.getResource(eq(resource), eq(CHILD3))).thenReturn(mock(Resource.class));
    when(resource.getPath()).thenReturn(COMPONENT);
    doNothing().when(resourceResolver).delete(any(Resource.class));
    DeleteResource deleteResourceAction = new DeleteResource(resourceResolver, CHILD1, CHILD2, CHILD3);
    String result = deleteResourceAction.doAction(resource);
    String expectedResult = String.format("Deleted child resource(s) [%s]. Child resource(s) [%s] were not found.",
            COMPONENT + PATH_SEPARATOR + CHILD1 + ", " + COMPONENT + PATH_SEPARATOR + CHILD3,
            COMPONENT + PATH_SEPARATOR + CHILD2);
    verify(resourceResolver, times(2)).delete(any(Resource.class));
    assertEquals(result, expectedResult);
}