11package com .axway .apim .export .test .impl ;
22
3- import com .axway .apim .adapter .APIManagerAdapter ;
43import com .axway .apim .api .API ;
54import com .axway .apim .api .export .impl .CheckCertificatesAPIHandler ;
65import com .axway .apim .api .export .lib .cli .CLICheckCertificatesOptions ;
1817import java .io .IOException ;
1918import java .util .List ;
2019
21- public class CheckCertificatesTest {
22-
20+ public class CheckCertificatesTest {
2321
2422
2523 private static final String TEST_PACKAGE = "test/export/files/apiLists/" ;
@@ -33,9 +31,9 @@ public void setTest() {
3331 }
3432
3533 @ Test
36- public void checkCertNothingAboutToExpire () throws IOException {
34+ public void checkCertNothingAboutToExpire () throws IOException {
3735
38- List <API > apis = mapper .readValue (this .getClass ().getClassLoader ().getResourceAsStream (TEST_PACKAGE + "three-apis-no-clientOrgs-and-clientApps.json" ), new TypeReference <>() {
36+ List <API > apis = mapper .readValue (this .getClass ().getClassLoader ().getResourceAsStream (TEST_PACKAGE + "three-apis-no-clientOrgs-and-clientApps.json" ), new TypeReference <List < API > >() {
3937 });
4038
4139 APICheckCertificatesParams params = (APICheckCertificatesParams ) CLICheckCertificatesOptions .create (new String []{"-days" , "30" }).getParams ();
@@ -47,16 +45,16 @@ public void checkCertNothingAboutToExpire() throws IOException {
4745
4846 @ Test
4947 public void checkSomeExpiredCerts () throws IOException {
50- List <API > apis = mapper .readValue (this .getClass ().getClassLoader ().getResourceAsStream (TEST_PACKAGE + "three-apis-no-clientOrgs-and-clientApps.json" ), new TypeReference <>() {
48+ List <API > apis = mapper .readValue (this .getClass ().getClassLoader ().getResourceAsStream (TEST_PACKAGE + "three-apis-no-clientOrgs-and-clientApps.json" ), new TypeReference <List < API > >() {
5149 });
5250
5351 APICheckCertificatesParams params = (APICheckCertificatesParams ) CLICheckCertificatesOptions .create (new String []{"-days" , "23350" }).getParams ();
5452 CheckCertificatesAPIHandler checkCerts = new CheckCertificatesAPIHandler (params );
5553 checkCerts .execute (apis );
5654 Result result = checkCerts .getResult ();
57- Assert .assertTrue (result .getErrorCode () == ErrorCode .CHECK_CERTS_FOUND_CERTS );
55+ Assert .assertSame (result .getErrorCode (), ErrorCode .CHECK_CERTS_FOUND_CERTS );
5856 @ SuppressWarnings ("unchecked" )
5957 List <CaCert > expiredCert = (List <CaCert >) result .getResultDetails ();
60- Assert .assertTrue (expiredCert .size () == 1 , "Expect one certificate to expire" );
58+ Assert .assertEquals (expiredCert .size (), 1 , "Expect one certificate to expire" );
6159 }
62- }
60+ }
0 commit comments