update link to upper-constraints.txt
[holmes/rule-management.git] / rulemgt / src / test / java / org / onap / holmes / rulemgt / dcae / ConfigFileScanningTaskTest.java
index 0f0f81a..cc29103 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * Copyright 2021 ZTE Corporation.
+ * Copyright 2021-2022 ZTE Corporation.
  * <p>
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -32,9 +32,6 @@ import org.powermock.core.classloader.annotations.SuppressStaticInitializationFo
 import org.powermock.modules.junit4.PowerMockRunner;
 import org.powermock.reflect.Whitebox;
 
-import java.util.HashMap;
-import java.util.Map;
-
 import static org.hamcrest.CoreMatchers.containsString;
 import static org.hamcrest.core.IsNot.not;
 import static org.junit.Assert.assertThat;
@@ -86,7 +83,7 @@ public class ConfigFileScanningTaskTest {
         EasyMock.expect(jcMock.get(EasyMock.anyString(), EasyMock.anyObject())).andReturn(rqlr);
 
         // mock for deployRule
-        EasyMock.expect(jcMock.header(EasyMock.anyString(), EasyMock.anyObject())).andReturn(jcMock);
+        EasyMock.expect(jcMock.header(EasyMock.anyString(), EasyMock.anyObject())).andReturn(jcMock).times(2);
         EasyMock.expect(jcMock.put(EasyMock.anyString(), EasyMock.anyObject())).andReturn("");
 
         PowerMock.replayAll();
@@ -174,7 +171,7 @@ public class ConfigFileScanningTaskTest {
         EasyMock.expect(jcMock.delete(EasyMock.anyString())).andReturn("");
 
         // mock for deployRule
-        EasyMock.expect(jcMock.header(EasyMock.anyString(), EasyMock.anyObject())).andReturn(jcMock);
+        EasyMock.expect(jcMock.header(EasyMock.anyString(), EasyMock.anyObject())).andReturn(jcMock).times(2);
         EasyMock.expect(jcMock.put(EasyMock.anyString(), EasyMock.anyObject())).andReturn("");
 
         PowerMock.replayAll();
@@ -219,6 +216,7 @@ public class ConfigFileScanningTaskTest {
         ruleResult4API.setContent(contents);
         ruleResult4API.setDescription("");
         ruleResult4API.setEnabled(1);
+        ruleResult4API.setCreator("__SYSTEM__DEFAULT__");
         return ruleResult4API;
     }
 }
\ No newline at end of file