You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by su...@apache.org on 2019/02/04 07:15:49 UTC

[hadoop] branch branch-3.2 updated: YARN-9263. TestConfigurationNodeAttributesProvider fails after Mockito updated. Contributed by Weiwei Yang.

This is an automated email from the ASF dual-hosted git repository.

sunilg pushed a commit to branch branch-3.2
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/branch-3.2 by this push:
     new a0fafbc  YARN-9263. TestConfigurationNodeAttributesProvider fails after Mockito updated. Contributed by Weiwei Yang.
a0fafbc is described below

commit a0fafbc3ef7ad35696dec6ef1f5f4740c3153d49
Author: Weiwei Yang <ww...@apache.org>
AuthorDate: Sat Feb 2 23:04:34 2019 +0800

    YARN-9263. TestConfigurationNodeAttributesProvider fails after Mockito updated. Contributed by Weiwei Yang.
    
    (cherry picked from commit f20b043a02bd5b20f68123b2a7ab86f7cb9fe32a)
---
 .../nodelabels/TestConfigurationNodeAttributesProvider.java        | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

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 bad74d8..5cee942 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());
 


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org