Skip to content

Commit 77426b9

Browse files
kofemannmksahakyan
authored andcommitted
pool: fix failing unit tests
Fix NPE triggered by changes in commit cfa8482 Target: master Require-book: no Require-notes: no (cherry picked from commit 8d870cf) Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
1 parent ec4c248 commit 77426b9

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

modules/dcache/src/test/java/org/dcache/pool/classic/AbstractMoverProtocolTransferServiceTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ public void setUp() throws Exception {
3333
moverProtocolMover = mock(MoverProtocolMover.class);
3434
when(moverProtocolMover.openChannel()).thenReturn(channel);
3535

36+
var protocolInfo = mock(ProtocolInfo.class);
37+
when(moverProtocolMover.getProtocolInfo()).thenReturn(protocolInfo);
38+
when(protocolInfo.getProtocol()).thenReturn("http");
39+
40+
var fileAttributes = FileAttributes.of()
41+
.pnfsId("0000123456789012345678901234567890FF")
42+
.build();
43+
44+
when(moverProtocolMover.getFileAttributes()).thenReturn(fileAttributes);
45+
3646
transferService = new AbstractMoverProtocolTransferService() {
3747
@Override
3848
protected MoverProtocol createMoverProtocol(ProtocolInfo info) throws Exception {

0 commit comments

Comments
 (0)