Skip to content

Commit d60ef69

Browse files
Pearl1594DaanHoogland
authored andcommitted
fix test identified by errorprone
1 parent 93cace4 commit d60ef69

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

engine/orchestration/src/main/java/com/cloud/agent/manager/DirectAgentAttache.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import java.util.ArrayList;
2020
import java.util.LinkedList;
2121
import java.util.List;
22-
import java.util.Objects;
2322
import java.util.concurrent.ScheduledFuture;
2423
import java.util.concurrent.TimeUnit;
2524
import java.util.concurrent.atomic.AtomicInteger;

engine/schema/src/test/java/com/cloud/network/as/AutoScaleVmProfileVOTest.java

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,15 @@ public void testCounterParamsForUpdate() {
4444
AutoScaleVmProfileVO profile = new AutoScaleVmProfileVO();
4545

4646
Map<String, LinkedHashMap<String, String>> counterParamList = new LinkedHashMap<>();
47-
counterParamList.put("0", new LinkedHashMap<>() {{ put("name", "snmpcommunity"); put("value", "public"); }});
48-
counterParamList.put("1", new LinkedHashMap<>() {{ put("name", "snmpport"); put("value", "161"); }});
47+
LinkedHashMap<String, String> param0 = new LinkedHashMap<>();
48+
param0.put("name", "snmpcommunity");
49+
param0.put("value", "public");
50+
counterParamList.put("0", param0);
51+
52+
LinkedHashMap<String, String> param1 = new LinkedHashMap<>();
53+
param1.put("name", "snmpport");
54+
param1.put("value", "161");
55+
counterParamList.put("1", param1);
4956

5057
profile.setCounterParamsForUpdate(counterParamList);
5158
Assert.assertEquals("snmpcommunity=public&snmpport=161", profile.getCounterParamsString());
@@ -63,8 +70,15 @@ public void tstSetOtherDeployParamsForUpdate() {
6370
AutoScaleVmProfileVO profile = new AutoScaleVmProfileVO();
6471

6572
Map<String, HashMap<String, String>> otherDeployParamsMap = new HashMap<>();
66-
otherDeployParamsMap.put("0", new HashMap<>() {{ put("name", "serviceofferingid"); put("value", "a7fb50f6-01d9-11ed-8bc1-77f8f0228926"); }});
67-
otherDeployParamsMap.put("1", new HashMap<>() {{ put("name", "rootdisksize"); put("value", "10"); }});
73+
HashMap<String, String> deployParam0 = new HashMap<>();
74+
deployParam0.put("name", "serviceofferingid");
75+
deployParam0.put("value", "a7fb50f6-01d9-11ed-8bc1-77f8f0228926");
76+
otherDeployParamsMap.put("0", deployParam0);
77+
78+
HashMap<String, String> deployParam1 = new HashMap<>();
79+
deployParam1.put("name", "rootdisksize");
80+
deployParam1.put("value", "10");
81+
otherDeployParamsMap.put("1", deployParam1);
6882

6983
profile.setOtherDeployParamsForUpdate(otherDeployParamsMap);
7084

engine/schema/src/test/java/com/cloud/upgrade/SystemVmTemplateRegistrationTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ public void testValidateTemplates_fileFailure() {
363363
systemVmTemplateRegistration.validateTemplates(list);
364364
}
365365

366+
@Test
366367
public void testValidateTemplates_downloadableFileNotFound() {
367368
CPU.CPUArch arch = SystemVmTemplateRegistration.DOWNLOADABLE_TEMPLATE_ARCH_TYPES.get(0);
368369
List<Pair<Hypervisor.HypervisorType, CPU.CPUArch>> list = new ArrayList<>();

0 commit comments

Comments
 (0)