@Before
 public void removeFooService() {
   GeoServer geoServer = getGeoServer();
   WorkspaceInfo ws = getCatalog().getDefaultWorkspace();
   ServiceInfo s = geoServer.getServiceByName(ws, "foo", ServiceInfo.class);
   if (s != null) {
     geoServer.remove(s);
   }
 }
  @Test
  public void testRemoveWorkspaceLocalService() throws Exception {
    testAddWorkspaceLocalService();

    File dataDirRoot = getTestData().getDataDirectoryRoot();
    WorkspaceInfo ws = getCatalog().getDefaultWorkspace();

    File f = new File(dataDirRoot, "workspaces" + "/" + ws.getName() + "/service.xml");
    assertTrue(f.exists());

    ServiceInfo s = geoServer.getServiceByName(ws, "foo", ServiceInfo.class);
    geoServer.remove(s);
    assertFalse(f.exists());
  }