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

jialiang pushed a commit to branch upgrade/jdk-spring-dependencies
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to 
refs/heads/upgrade/jdk-spring-dependencies by this push:
     new f51ae29d56 AMBARI-26220: Fix ConfigureClusterTaskTest Unexpected 
method calls: ClusterConfigurationRequest.getRequiredHostGroups() error (#3864)
f51ae29d56 is described below

commit f51ae29d5685cb506d8d5ae2d6462f9a7e0e4f3d
Author: coldless177 <[email protected]>
AuthorDate: Fri Nov 1 10:46:55 2024 +0800

    AMBARI-26220: Fix ConfigureClusterTaskTest Unexpected method calls: 
ClusterConfigurationRequest.getRequiredHostGroups() error (#3864)
    
    fix AsyncCallableServiceTest Unexpected method calls: Callable.call() error
---
 .../org/apache/ambari/server/topology/AsyncCallableServiceTest.java    | 2 +-
 .../org/apache/ambari/server/topology/ConfigureClusterTaskTest.java    | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/topology/AsyncCallableServiceTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/topology/AsyncCallableServiceTest.java
index 348b8272b5..06c1d60275 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/topology/AsyncCallableServiceTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/topology/AsyncCallableServiceTest.java
@@ -152,7 +152,7 @@ public class AsyncCallableServiceTest extends 
EasyMockSupport {
   @Test
   public void 
testCallableServiceShouldRetryTaskExecutionTillTimeoutExceededWhenTaskThrowsException()
 throws Exception {
     // GIVEN
-    expect(taskMock.call()).andThrow(new 
IllegalStateException("****************** TESTING ****************")).times(2, 
3);
+    expect(taskMock.call()).andThrow(new 
IllegalStateException("****************** TESTING ****************")).times(2, 
20);
     onErrorMock.accept(anyObject(IllegalStateException.class));
     replayAll();
     asyncCallableService = new AsyncCallableService<>(taskMock, TIMEOUT, 
RETRY_DELAY,  "test", onErrorMock);
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/topology/ConfigureClusterTaskTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/topology/ConfigureClusterTaskTest.java
index 925e6cbfa0..6e5f47dbd1 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/topology/ConfigureClusterTaskTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/topology/ConfigureClusterTaskTest.java
@@ -90,6 +90,9 @@ public class ConfigureClusterTaskTest extends EasyMockSupport 
{
     // GIVEN
     
expect(clusterConfigurationRequest.getRequiredHostGroups()).andReturn(Collections.emptyList());
     
expect(clusterTopology.getHostGroupInfo()).andReturn(Collections.emptyMap());
+    expect(clusterTopology.getClusterId()).andReturn(1L).anyTimes();
+    expect(clusterTopology.getAmbariContext()).andReturn(ambariContext);
+    expect(ambariContext.getClusterName(1L)).andReturn("testCluster");
     clusterConfigurationRequest.process();
     replayAll();
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to