new ContainerRequestUserRole("POST", new URI(REST_REPOSITORY_SERVICE_PATH
+ RestRepositoryService.Constants.OperationType.REMOVE_WORKSPACE + "/" + rName + "/" + wsName + "/false/"),
new URI(""), null, new InputHeadersMap(headers));
ByteArrayContainerResponseWriter responseWriter = new ByteArrayContainerResponseWriter();
ContainerResponse cres = new ContainerResponse(responseWriter);
handler.handleRequest(creq, cres);
assertEquals(409, cres.getStatus());
//remove with prepare close sessions
creq =
new ContainerRequestUserRole("POST", new URI(REST_REPOSITORY_SERVICE_PATH
+ RestRepositoryService.Constants.OperationType.REMOVE_WORKSPACE + "/" + rName + "/" + wsName + "/true/"),
new URI(""), null, new InputHeadersMap(headers));
responseWriter = new ByteArrayContainerResponseWriter();
cres = new ContainerResponse(responseWriter);
handler.handleRequest(creq, cres);
assertEquals(200, cres.getStatus());
try
{
repositoryService.getRepository(rName).login(new CredentialsImpl("root", "exo".toCharArray()), wsName);
fail("The workspace /" + rName + "/" + wsName + "should be removed. ");