@Test
public void testHandleLocationDeleted() {

    ServiceResource serviceResource = new ServiceResource();
    serviceResource.setId("service1");
    serviceResource.setLocationIds(new String[] { "location1", "location2" });
    alienDao.save(serviceResource);
    serviceResourceService.handleLocationDeleted(new AfterLocationDeleted(this, "location3"));
    serviceResource = serviceResourceService.getOrFail("service1");
    Assert.assertArrayEquals(new String[] { "location1", "location2" }, serviceResource.getLocationIds());
    serviceResourceService.handleLocationDeleted(new AfterLocationDeleted(this, "location1"));
    serviceResource = serviceResourceService.getOrFail("service1");
    Assert.assertArrayEquals(new String[] { "location2" }, serviceResource.getLocationIds());
}