From f7a83ac201c1ebfee4625b887c0c554bb21d8f54 Mon Sep 17 00:00:00 2001 From: Richard Richter Date: Sun, 1 Mar 2020 13:22:39 +0100 Subject: [PATCH] AbstractModelIntegrationTest: fix of NPE on dummyAuditService DummyAuditService is not a managed component, so we can safely init it in constructor and then we don't have to check its nullity. NPE happened in TestLoggingConfiguration test that (for good reasons) didn't call super.initSystem(). --- .../midpoint/model/test/AbstractModelIntegrationTest.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/model/model-test/src/main/java/com/evolveum/midpoint/model/test/AbstractModelIntegrationTest.java b/model/model-test/src/main/java/com/evolveum/midpoint/model/test/AbstractModelIntegrationTest.java index d065c807589..216faf9d544 100644 --- a/model/model-test/src/main/java/com/evolveum/midpoint/model/test/AbstractModelIntegrationTest.java +++ b/model/model-test/src/main/java/com/evolveum/midpoint/model/test/AbstractModelIntegrationTest.java @@ -203,7 +203,7 @@ public abstract class AbstractModelIntegrationTest extends AbstractIntegrationTe protected boolean verbose = false; public AbstractModelIntegrationTest() { - super(); + dummyAuditService = DummyAuditService.getInstance(); } @Override @@ -211,7 +211,6 @@ public void initSystem(Task initTask, OperationResult initResult) throws Excepti logger.trace("initSystem"); dummyResourceCollection = new DummyResourceCollection(modelService); startResources(); - dummyAuditService = DummyAuditService.getInstance(); InternalsConfig.reset(); InternalsConfig.setAvoidLoggingChange(isAvoidLoggingChange()); // Make sure the checks are turned on