Skip to content

Commit

Permalink
pool: adjust StorageClassContainerTest for dcache pre- 7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kofemann authored and mksahakyan committed Nov 30, 2021
1 parent 4630b7d commit b4270dc
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
import static org.mockito.Mockito.when;

import diskCacheV111.util.CacheException;
import diskCacheV111.util.PnfsId;
import java.util.concurrent.TimeUnit;
import org.dcache.chimera.InodeId;
import org.dcache.pool.nearline.NearlineStorageHandler;
import org.dcache.pool.repository.CacheEntry;
import org.dcache.vehicles.FileAttributes;
Expand Down Expand Up @@ -70,14 +72,17 @@ private void assertMatchTemplate(StorageClassInfo template, StorageClassInfo act

private CacheEntry givenCacheEntry(String hsm, String storageClass) {

PnfsId id = new PnfsId(InodeId.newID(0));

var attr = FileAttributes.of()
.storageClass(storageClass)
.hsm(hsm)
.pnfsId(id)
.build();

var ce = mock(CacheEntry.class);
when(ce.getFileAttributes()).thenReturn(attr);
when(ce.getPnfsId()).thenReturn(id);

return ce;
}
Expand Down

0 comments on commit b4270dc

Please sign in to comment.