HDDS-849. Fix NPE in TestKeyValueHandler because of audit log write.

Contributed by Dinesh Chitlangia.
This commit is contained in:
Nanda kumar 2018-11-19 22:47:43 +05:30
parent 8b23814415
commit e7438a1b38
1 changed files with 4 additions and 0 deletions

View File

@ -90,6 +90,10 @@ public class TestKeyValueHandler {
Mockito.when(handler.handle(any(), any())).thenCallRealMethod();
doCallRealMethod().when(dispatcher).setMetricsForTesting(any());
dispatcher.setMetricsForTesting(Mockito.mock(ContainerMetrics.class));
Mockito.when(dispatcher.buildAuditMessageForFailure(any(), any(), any()))
.thenCallRealMethod();
Mockito.when(dispatcher.buildAuditMessageForSuccess(any(), any()))
.thenCallRealMethod();
}
@Test