Skip to content

Commit 757d863

Browse files
committed
fix compile error
1 parent 7b7b64d commit 757d863

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

project-payment-calculator/src/test/java/com/topcoder/management/payment/calculator/Demo.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,9 @@ public void demoAPI() throws Exception {
183183

184184
Map<Long, BigDecimal> result = calculator.getDefaultPayments(230, resourceRoleIDs);
185185
System.out.println("Default payment: ");
186-
result.forEach((roleId, payment) -> System.out.println("Payment for role " + roleId + " = " + payment));
186+
for(Long roleId : result.keySet()) {
187+
System.out.println("Payment for role " + roleId + " = " + result.get(roleId));
188+
}
187189

188190
// The returned Map will contain two entries :
189191
// The first element : key = 2, BigDecimal value = 10 = 0 + (0.0 + 0.01*2)*500
@@ -225,6 +227,8 @@ public void demoAPI() throws Exception {
225227
// first element : key = 2, value = 14 (adjusted to the value of fixed_amount)
226228
// second element : key = 4, value = 22 (adjusted to the value of fixed_amount).
227229
// third element : key = 8, value = (10 + (0.00 + 0.00*0)*500 ) * 2 = 20 (multiplier == 2)
228-
adjustedPayments.forEach((roleId, adjustedPayment) -> System.out.println("Adjusted Payment for role " + roleId + " = " + adjustedPayment));
230+
for (Long roleId: adjustedPayments.keySet()) {
231+
System.out.println("Adjusted Payment for role " + roleId + " = " + adjustedPayments.get(roleId));
232+
}
229233
}
230234
}

project-payment-calculator/src/test/java/com/topcoder/management/payment/calculator/failuretests/DefaultProjectPaymentCalculatorFailureTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public void testGetDefaultPayments_invalid_3() throws Exception {
190190
+ "config.xml"));
191191
obj = obj.getChild(DefaultProjectPaymentCalculator.DEFAULT_CONFIG_NAMESPACE);
192192
DefaultProjectPaymentCalculator instance = new DefaultProjectPaymentCalculator(obj);
193-
instance.getDefaultPayments(1, new ArrayList<>());
193+
instance.getDefaultPayments(1L, new ArrayList<Long>());
194194
}
195195

196196
/**
@@ -210,7 +210,7 @@ public void testGetDefaultPayments_invalid_4() throws Exception {
210210
+ "config.xml"));
211211
obj = obj.getChild(DefaultProjectPaymentCalculator.DEFAULT_CONFIG_NAMESPACE);
212212
DefaultProjectPaymentCalculator instance = new DefaultProjectPaymentCalculator(obj);
213-
instance.getDefaultPayments(1, Collections.singletonList(null));
213+
instance.getDefaultPayments(1L, Collections.singletonList((Long)null));
214214
}
215215

216216
/**

project-payment-calculator/src/test/java/com/topcoder/management/payment/calculator/failuretests/ProjectPaymentAdjustmentCalculatorFailureTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ public void testGetDefaultPayments_invalid_3() throws Exception {
189189
+ "config.xml"));
190190
obj = obj.getChild(ProjectPaymentAdjustmentCalculator.DEFAULT_CONFIG_NAMESPACE);
191191
ProjectPaymentAdjustmentCalculator instance = new ProjectPaymentAdjustmentCalculator(obj);
192-
instance.getDefaultPayments(1, new ArrayList<>());
192+
instance.getDefaultPayments(1L, new ArrayList<Long>());
193193
}
194194

195195
/**
@@ -209,6 +209,6 @@ public void testGetDefaultPayments_invalid_4() throws Exception {
209209
+ "config.xml"));
210210
obj = obj.getChild(ProjectPaymentAdjustmentCalculator.DEFAULT_CONFIG_NAMESPACE);
211211
ProjectPaymentAdjustmentCalculator instance = new ProjectPaymentAdjustmentCalculator(obj);
212-
instance.getDefaultPayments(1, Collections.singletonList(null));
212+
instance.getDefaultPayments(1L, Collections.singletonList((Long)null));
213213
}
214214
}

project-payment-calculator/src/test/java/com/topcoder/management/payment/calculator/impl/DefaultProjectPaymentCalculatorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ public void testGetDefaultPayments_NullResourceRoleIDs() throws Exception {
698698
*/
699699
@Test(expected = IllegalArgumentException.class)
700700
public void testGetDefaultPayments_EmptyResourceRoleIDs() throws Exception {
701-
calc.getDefaultPayments(230, new ArrayList<>());
701+
calc.getDefaultPayments(230L, new ArrayList<Long>());
702702
}
703703

704704
/**

project-payment-calculator/src/test/java/com/topcoder/management/payment/calculator/impl/ProjectPaymentAdjustmentCalculatorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ public void testGetDefaultPayments_NullResourceRoleIDs() throws Exception {
837837
*/
838838
@Test(expected = IllegalArgumentException.class)
839839
public void testGetDefaultPayments_EmptyResourceRoleIDs() throws Exception {
840-
calc.getDefaultPayments(230, new ArrayList<>());
840+
calc.getDefaultPayments(230L, new ArrayList<Long>());
841841
}
842842

843843
/**

0 commit comments

Comments
 (0)