You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by "jojochuang (via GitHub)" <gi...@apache.org> on 2025/04/16 03:15:45 UTC

[PR] AMBARI-26461: NotAMock Argument should be a mock, but is: class java.lang.Class. [ambari]

jojochuang opened a new pull request, #3984:
URL: https://github.com/apache/ambari/pull/3984

   ## What changes were proposed in this pull request?
   
   Fix powermock test errors by applying the solution in https://stackoverflow.com/questions/62742777/org-mockito-exceptions-misusing-notamockexception-argument-should-be-a-mock-bu
   
         You can solve the issue using the below code. Hope this will help you. Please replace below the line
         
         PowerMockito.when(SSLContext.getInstance(anyString())).thenReturn(sslContextMock);
         with
         
         when(SSLContext.getInstance(anyString())).thenAnswer((Answer<SSLContext>) invocation -> sslContextMock);
   
   
   ## How was this patch tested?
   
   mvn -am test -pl ambari-server -DskipPythonTests -Dmaven.test.failure.ignore -Dmaven.artifact.threads=10 -Drat.skip -DskipAdminWebTests=true  -Dtest=AmbariMetricsHadoopSinkVersionCheckTest,ComponentsInstallationCheckTest,ServicesUpCheckTest,UpgradeUserKerberosDescriptorTest -Dsurefire.failIfNoSpecifiedTests=false


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ambari.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ambari.apache.org
For additional commands, e-mail: dev-help@ambari.apache.org


Re: [PR] AMBARI-26461: NotAMock Argument should be a mock, but is: class java.lang.Class. [ambari]

Posted by "jojochuang (via GitHub)" <gi...@apache.org>.
jojochuang merged PR #3984:
URL: https://github.com/apache/ambari/pull/3984


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ambari.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ambari.apache.org
For additional commands, e-mail: dev-help@ambari.apache.org


Re: [PR] AMBARI-26461: NotAMock Argument should be a mock, but is: class java.lang.Class. [ambari]

Posted by "jojochuang (via GitHub)" <gi...@apache.org>.
jojochuang commented on PR #3984:
URL: https://github.com/apache/ambari/pull/3984#issuecomment-2808184519

   Merged. Thanks for the review @JiaLiangC 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ambari.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ambari.apache.org
For additional commands, e-mail: dev-help@ambari.apache.org