diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/nodelabels/TestConfigurationNodeAttributesProvider.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/nodelabels/TestConfigurationNodeAttributesProvider.java index bad74d80db9..5cee9426f40 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/nodelabels/TestConfigurationNodeAttributesProvider.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/nodelabels/TestConfigurationNodeAttributesProvider.java @@ -93,7 +93,7 @@ public class TestConfigurationNodeAttributesProvider { YarnConfiguration.NM_NODE_ATTRIBUTES_PROVIDER_FETCH_INTERVAL_MS, 1000); ConfigurationNodeAttributesProvider spyProvider = Mockito.spy(nodeAttributesProvider); - Mockito.when(spyProvider.parseAttributes(Mockito.anyString())) + Mockito.when(spyProvider.parseAttributes(Mockito.any())) .thenReturn(expectedAttributes1); spyProvider.init(conf); @@ -107,7 +107,7 @@ public class TestConfigurationNodeAttributesProvider { expectedAttributes2.add(NodeAttribute .newInstance("test.io", "os", NodeAttributeType.STRING, "windows")); - Mockito.when(spyProvider.parseAttributes(Mockito.anyString())) + Mockito.when(spyProvider.parseAttributes(Mockito.any())) .thenReturn(expectedAttributes2); // Since we set fetch interval to 1s, it needs to wait for 1s until @@ -152,11 +152,10 @@ public class TestConfigurationNodeAttributesProvider { YarnConfiguration.NM_NODE_ATTRIBUTES_PROVIDER_FETCH_INTERVAL_MS, -1); ConfigurationNodeAttributesProvider spyProvider = Mockito.spy(nodeAttributesProvider); - Mockito.when(spyProvider.parseAttributes(Mockito.anyString())) + Mockito.when(spyProvider.parseAttributes(Mockito.any())) .thenReturn(expectedAttributes1); spyProvider.init(conf); spyProvider.start(); - Assert.assertEquals(expectedAttributes1, spyProvider.getDescriptors());