Skip to content

Commit

Permalink
Fix test.
Browse files Browse the repository at this point in the history
  • Loading branch information
dbernstein committed Mar 1, 2024
1 parent 66316b1 commit fb33c8d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -489,20 +489,19 @@ public void finalizeRestores() {
try {
String spaceId = destination.getSpaceId();
boolean spaceExists = store.spaceExists(spaceId);
boolean spaceEmpty = false;


if(spaceExists) {
Iterator<String> it = store.getSpaceContents(spaceId);
spaceEmpty = !it.hasNext();
if (spaceEmpty) { // if space is empty
if (!it.hasNext()) { // if space is empty
// Call DuraCloud to remove space
log.info("Deleting expired restoration space: " + spaceId +
" at host: " + destination.getHost());
store.deleteSpace(spaceId);
spaceExists = false;
}
}

if (!spaceExists || spaceEmpty){
if (!spaceExists){
// Update restore status
validateAndSet(restoration,
RestoreStatus.RESTORATION_EXPIRED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ public void testFinalizeRestores() throws Exception {

expect(destination.getSpaceId()).andReturn(spaceId);
expect(destination.getHost()).andReturn(host);
expect(contentStore.spaceExists(spaceId)).andReturn(true);
expect(contentStore.getSpaceContents(spaceId))
.andReturn(Collections.<String>emptyList().iterator());

Expand Down

0 comments on commit fb33c8d

Please sign in to comment.