Skip to content

Commit 168b7f9

Browse files
Fix UTs for TestCombinedSystemMetricsPublisher
1 parent df3b2a7 commit 168b7f9

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/TestCombinedSystemMetricsPublisher.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ private static RMAppAttempt createRMAppAttempt(boolean unmanagedAMAttempt) {
447447
RMAppAttempt appAttempt = mock(RMAppAttempt.class);
448448
when(appAttempt.getAppAttemptId()).thenReturn(appAttemptId);
449449
when(appAttempt.getHost()).thenReturn("test host");
450-
when(appAttempt.getRpcPort()).thenReturn(Integer.valueOf(-100));
450+
when(appAttempt.getRpcPort()).thenReturn(-100);
451451
if (!unmanagedAMAttempt) {
452452
Container container = mock(Container.class);
453453
when(container.getId())
@@ -468,9 +468,9 @@ private static RMApp createRMApp(ApplicationId appId) {
468468
when(rmApp.getApplicationType()).thenReturn("test app type");
469469
when(rmApp.getUser()).thenReturn("testUser");
470470
when(rmApp.getQueue()).thenReturn("test queue");
471-
when(rmApp.getSubmitTime()).thenReturn(Long.valueOf(Integer.MAX_VALUE + 1L));
472-
when(rmApp.getStartTime()).thenReturn(Long.valueOf(Integer.MAX_VALUE + 2L));
473-
when(rmApp.getFinishTime()).thenReturn(Long.valueOf(Integer.MAX_VALUE + 3L));
471+
when(rmApp.getSubmitTime()).thenReturn(Integer.MAX_VALUE + 1L);
472+
when(rmApp.getStartTime()).thenReturn(Integer.MAX_VALUE + 2L);
473+
when(rmApp.getFinishTime()).thenReturn(Integer.MAX_VALUE + 3L);
474474
when(rmApp.getDiagnostics()).thenReturn(
475475
new StringBuilder("test diagnostics info"));
476476
RMAppAttempt appAttempt = mock(RMAppAttempt.class);
@@ -481,12 +481,12 @@ private static RMApp createRMApp(ApplicationId appId) {
481481
FinalApplicationStatus.UNDEFINED);
482482
Map<String, Long> resourceMap = new HashMap<>();
483483
resourceMap
484-
.put(ResourceInformation.MEMORY_MB.getName(), Long.valueOf((long) Integer.MAX_VALUE));
485-
resourceMap.put(ResourceInformation.VCORES.getName(), Long.valueOf(Long.MAX_VALUE));
484+
.put(ResourceInformation.MEMORY_MB.getName(), (long) Integer.MAX_VALUE);
485+
resourceMap.put(ResourceInformation.VCORES.getName(), Long.MAX_VALUE);
486486
Map<String, Long> preemptedMap = new HashMap<>();
487487
preemptedMap
488-
.put(ResourceInformation.MEMORY_MB.getName(), Long.valueOf((long) Integer.MAX_VALUE));
489-
preemptedMap.put(ResourceInformation.VCORES.getName(), Long.valueOf(Long.MAX_VALUE));
488+
.put(ResourceInformation.MEMORY_MB.getName(), (long) Integer.MAX_VALUE);
489+
preemptedMap.put(ResourceInformation.VCORES.getName(), Long.MAX_VALUE);
490490
when(rmApp.getRMAppMetrics()).thenReturn(
491491
new RMAppMetrics(Resource.newInstance(0, 0), 0, 0, resourceMap,
492492
preemptedMap, 0));

0 commit comments

Comments
 (0)