testWsSession.save();
testWsSession.logout();
// workspace deletion clears the cache asynchronously so we need to wait until that completes
final CountDownLatch workspaceDeletedLatch = new CountDownLatch(1);
repository.changeBus().register(new ChangeSetListener() {
@Override
public void notify( ChangeSet changeSet ) {
for (Change change : changeSet) {
if (change instanceof WorkspaceRemoved && ((WorkspaceRemoved)change).getWorkspaceName().equals(wsName)) {
try {