diff options
Diffstat (limited to 'certServiceClient/src/test/java/org/onap/aaf/certservice')
-rw-r--r-- | certServiceClient/src/test/java/org/onap/aaf/certservice/client/CertServiceClientTest.java (renamed from certServiceClient/src/test/java/org/onap/aaf/certservice/client/CertServiceClientAppTest.java) | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/certServiceClient/src/test/java/org/onap/aaf/certservice/client/CertServiceClientAppTest.java b/certServiceClient/src/test/java/org/onap/aaf/certservice/client/CertServiceClientTest.java index e9d169a0..12c2db06 100644 --- a/certServiceClient/src/test/java/org/onap/aaf/certservice/client/CertServiceClientAppTest.java +++ b/certServiceClient/src/test/java/org/onap/aaf/certservice/client/CertServiceClientTest.java @@ -20,15 +20,29 @@ package org.onap.aaf.certservice.client; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Spy; +import org.mockito.junit.jupiter.MockitoExtension; -class CertServiceClientAppTest { +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.verify; + +@ExtendWith(MockitoExtension.class) +class CertServiceClientTest { + @Spy + CertServiceClient certServiceClient = new CertServiceClient(); // Sonar check for this test disabled due to lack of assertion in test. // Intention of this test is to check if app runs without exiting Java. @Test - public void mainShouldSucceed() { //NOSONAR + public void shouldExitWithZero_onApplicationSuccessfulFinish() { //NOSONAR + // given String[] params = {""}; - CertServiceClientApp.main(params); + doNothing().when(certServiceClient).exit(0); + // when + certServiceClient.run(params); + // then + verify(certServiceClient).exit(0); } }
\ No newline at end of file |