Skip to content

Commit d8cb161

Browse files
committed
- Fix for JDK 1.8 compatibility
1 parent d56aeab commit d8cb161

2 files changed

Lines changed: 20 additions & 23 deletions

File tree

modules/apis/src/test/java/com/axway/apim/export/test/impl/CheckCertificatesTest.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.axway.apim.export.test.impl;
22

3-
import com.axway.apim.adapter.APIManagerAdapter;
43
import com.axway.apim.api.API;
54
import com.axway.apim.api.export.impl.CheckCertificatesAPIHandler;
65
import com.axway.apim.api.export.lib.cli.CLICheckCertificatesOptions;
@@ -18,8 +17,7 @@
1817
import java.io.IOException;
1918
import 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+
}
Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.axway.apim.export.test.impl;
22

3-
import com.axway.apim.adapter.APIManagerAdapter;
43
import com.axway.apim.api.API;
54
import com.axway.apim.api.export.impl.ConsoleAPIExporter;
65
import com.axway.apim.api.export.lib.cli.CLIAPIExportOptions;
@@ -15,43 +14,43 @@
1514
import java.util.List;
1615

1716
public class ConsoleAPIExportTest {
18-
17+
1918
private static final String TEST_PACKAGE = "test/export/files/apiLists/";
20-
19+
2120
ObjectMapper mapper = new ObjectMapper();
22-
23-
21+
22+
2423
@BeforeClass
2524
public void setTest() {
2625
mapper.disable(MapperFeature.USE_ANNOTATIONS);
2726
}
28-
27+
2928
@Test
3029
public void runStandardConsoleAPIExport() throws IOException {
31-
List<API> apis = mapper.readValue(this.getClass().getClassLoader().getResourceAsStream(TEST_PACKAGE + "three-apis-no-clientOrgs-and-clientApps.json"), new TypeReference<>() {
30+
List<API> apis = mapper.readValue(this.getClass().getClassLoader().getResourceAsStream(TEST_PACKAGE + "three-apis-no-clientOrgs-and-clientApps.json"), new TypeReference<List<API>>() {
3231
});
3332
APIExportParams cmdParams = (APIExportParams) CLIAPIExportOptions.create(new String[] {}).getParams();
3433
ConsoleAPIExporter consoleExp = new ConsoleAPIExporter(cmdParams);
3534
consoleExp.execute(apis);
3635
}
37-
36+
3837
@Test
3938
public void runWideConsoleAPIExport() throws IOException {
40-
List<API> apis = mapper.readValue(this.getClass().getClassLoader().getResourceAsStream(TEST_PACKAGE + "three-apis-no-clientOrgs-and-clientApps.json"), new TypeReference<>() {
39+
List<API> apis = mapper.readValue(this.getClass().getClassLoader().getResourceAsStream(TEST_PACKAGE + "three-apis-no-clientOrgs-and-clientApps.json"), new TypeReference<List<API>>() {
4140
});
42-
41+
4342
APIExportParams cmdParams = (APIExportParams) CLIAPIExportOptions.create(new String[] {"-wide"}).getParams();
4443
ConsoleAPIExporter consoleExp = new ConsoleAPIExporter(cmdParams);
4544
consoleExp.execute(apis);
4645
}
47-
46+
4847
@Test
4948
public void runUltraConsoleAPIExport() throws IOException {
50-
List<API> apis = mapper.readValue(this.getClass().getClassLoader().getResourceAsStream(TEST_PACKAGE + "three-apis-no-clientOrgs-and-clientApps.json"), new TypeReference<>() {
49+
List<API> apis = mapper.readValue(this.getClass().getClassLoader().getResourceAsStream(TEST_PACKAGE + "three-apis-no-clientOrgs-and-clientApps.json"), new TypeReference<List<API>>() {
5150
});
52-
51+
5352
APIExportParams cmdParams = (APIExportParams) CLIAPIExportOptions.create(new String[] {"-ultra"}).getParams();
5453
ConsoleAPIExporter consoleExp = new ConsoleAPIExporter(cmdParams);
5554
consoleExp.execute(apis);
5655
}
57-
}
56+
}

0 commit comments

Comments
 (0)