diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/TestContainerMetrics.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/TestContainerMetrics.java index 60f6604259..6966489603 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/TestContainerMetrics.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/TestContainerMetrics.java @@ -20,7 +20,6 @@ import org.apache.hadoop.metrics2.AbstractMetric; import org.apache.hadoop.metrics2.MetricsRecord; -import org.apache.hadoop.metrics2.MetricsSystem; import org.apache.hadoop.metrics2.impl.MetricsCollectorImpl; import org.apache.hadoop.metrics2.impl.MetricsRecords; import org.apache.hadoop.metrics2.impl.MetricsSystemImpl; @@ -37,9 +36,6 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyString; -import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; public class TestContainerMetrics { @@ -48,10 +44,6 @@ public class TestContainerMetrics { public void testContainerMetricsFlow() throws InterruptedException { final String ERR = "Error in number of records"; - // Create a dummy MetricsSystem - MetricsSystem system = mock(MetricsSystem.class); - doReturn(this).when(system).register(anyString(), anyString(), any()); - MetricsCollectorImpl collector = new MetricsCollectorImpl(); ContainerId containerId = mock(ContainerId.class); ContainerMetrics metrics = ContainerMetrics.forContainer(containerId, @@ -89,9 +81,6 @@ public void testContainerMetricsFlow() throws InterruptedException { public void testContainerMetricsLimit() throws InterruptedException { final String ERR = "Error in number of records"; - MetricsSystem system = mock(MetricsSystem.class); - doReturn(this).when(system).register(anyString(), anyString(), any()); - MetricsCollectorImpl collector = new MetricsCollectorImpl(); ContainerId containerId = mock(ContainerId.class); ContainerMetrics metrics = ContainerMetrics.forContainer(containerId,