Skip to content

Commit 60e6aca

Browse files
author
rathnapandi
committed
- fix integration test related to swagger.io certificates and user issue
1 parent aeb5d1a commit 60e6aca

5 files changed

Lines changed: 7 additions & 29 deletions

File tree

modules/apis/src/test/java/com/axway/apim/export/test/applications/ApplicationExportTestIT.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,16 @@ public void run(@Optional @CitrusResource TestContext context) throws IOExceptio
9292
assertFalse(exportedAPIConfig.get("caCerts").get(0).get("inbound").asBoolean());
9393
assertTrue(exportedAPIConfig.get("caCerts").get(0).get("outbound").asBoolean());
9494

95-
List<ClientApplication> exportedApps = mapper.convertValue(exportedAPIConfig.get("applications"), new TypeReference<List<ClientApplication>>() {
95+
List<ClientApplication> exportedApps = mapper.convertValue(exportedAPIConfig.get("applications"), new TypeReference<>() {
9696
});
9797
assertEquals(exportedApps.size(), 1, "Number of exported apps not correct");
9898
ClientApplication app = exportedApps.get(0);
9999
assertTrue(app.getApiAccess() == null || app.getApiAccess().isEmpty(), "Exported Apps should not contains API-Access");
100100
assertNull(app.getId(), "The ID of an application shouldn't be exported.");
101101
assertNull(app.getAppQuota(), "The application quota should not be exported. It's not supported by the export!");
102102
assertTrue(new File(context.getVariable("exportLocation") + "/" + context.getVariable("exportFolder") + "/swagger.io.crt").exists(), "Certificate swagger.io.crt is missing");
103-
assertTrue(new File(context.getVariable("exportLocation") + "/" + context.getVariable("exportFolder") + "/WE1.crt").exists(), "Certificate WE1.crt is missing");
103+
assertTrue(new File(context.getVariable("exportLocation") + "/" + context.getVariable("exportFolder") + "/AmazonRSA2048M04.crt").exists(), "Certificate StarfieldServicesRootCertificateAuthority-G2.crt is missing");
104+
assertTrue(new File(context.getVariable("exportLocation") + "/" + context.getVariable("exportFolder") + "/AmazonRootCA1.crt").exists(), "Certificate AmazonRootCA1.crt is missing");
104105
assertTrue(new File(context.getVariable("exportLocation") + "/" + context.getVariable("exportFolder") + "/" + context.getVariable("exportAPIName")).exists(), "Exported Swagger-File is missing");
105106
}
106107
}

modules/apis/src/test/java/com/axway/apim/export/test/basic/SimpleAPIExportTestIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ public void run(@Optional @CitrusResource TestContext context) throws IOExceptio
9999
assertFalse(exportedAPIConfig.get("caCerts").get(0).get("inbound").asBoolean());
100100
assertTrue(exportedAPIConfig.get("caCerts").get(0).get("outbound").asBoolean());
101101
assertTrue(new File(context.getVariable("exportLocation") + "/" + context.getVariable("exportFolder") + "/swagger.io.crt").exists(), "Certificate swagger.io.crt is missing");
102-
assertTrue(new File(context.getVariable("exportLocation") + "/" + context.getVariable("exportFolder") + "/WE1.crt").exists(), "Certificate WE1.crt is missing");
103-
102+
assertTrue(new File(context.getVariable("exportLocation") + "/" + context.getVariable("exportFolder") + "/AmazonRSA2048M04.crt").exists(), "Certificate StarfieldServicesRootCertificateAuthority-G2.crt is missing");
103+
assertTrue(new File(context.getVariable("exportLocation") + "/" + context.getVariable("exportFolder") + "/AmazonRootCA1.crt").exists(), "Certificate AmazonRootCA1.crt is missing");
104104
File exportedAPISpecFile = new File(context.getVariable("exportLocation") + "/" + context.getVariable("exportFolder") + "/" + context.getVariable("exportAPIName"));
105105
assertTrue(exportedAPISpecFile.exists(), "Exported API-Specification is missing");
106106
// Read the export Swagger-File

modules/apis/src/test/java/com/axway/apim/export/test/basic/WildcardAPIExportTestIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ public void run(@Optional @CitrusResource TestContext context) throws IOExceptio
108108
assertTrue(exportedAPIConfig.get("caCerts").get(0).get("outbound").asBoolean());
109109

110110
assertTrue(new File(context.getVariable("exportLocation") + "/" + context.getVariable("exportFolder2") + "/swagger.io.crt").exists(), "Certificate swagger.io.crt is missing");
111-
assertTrue(new File(context.getVariable("exportLocation") + "/" + context.getVariable("exportFolder2") + "/WE1.crt").exists(), "Certificate WE1.crt is missing");
112-
//assertTrue(new File(context.getVariable("exportLocation")+"/"+context.getVariable("exportFolder2")+"/Amazon.crt").exists(), "Certificate Amazon.crt is missing");
111+
assertTrue(new File(context.getVariable("exportLocation") + "/" + context.getVariable("exportFolder") + "/AmazonRSA2048M04.crt").exists(), "Certificate StarfieldServicesRootCertificateAuthority-G2.crt is missing");
112+
assertTrue(new File(context.getVariable("exportLocation") + "/" + context.getVariable("exportFolder") + "/AmazonRootCA1.crt").exists(), "Certificate AmazonRootCA1.crt is missing"); //assertTrue(new File(context.getVariable("exportLocation")+"/"+context.getVariable("exportFolder2")+"/Amazon.crt").exists(), "Certificate Amazon.crt is missing");
113113
assertTrue(new File(context.getVariable("exportLocation") + "/" + context.getVariable("exportFolder2") + "/" + context.getVariable("exportAPIName2")).exists(), "Exported Swagger-File is missing");
114114
}
115115
}

modules/apis/src/test/java/com/axway/apim/test/envProperties/UsingEnvironmentTestIT.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
import com.axway.apim.test.ImportTestAction;
55
import org.citrusframework.annotations.CitrusTest;
66
import org.citrusframework.functions.core.RandomNumberFunction;
7-
import org.citrusframework.http.client.HttpClient;
87
import org.citrusframework.testng.spring.TestNGCitrusSpringSupport;
9-
import org.springframework.beans.factory.annotation.Autowired;
10-
import org.springframework.beans.factory.annotation.Value;
118
import org.springframework.test.context.ContextConfiguration;
129
import org.testng.annotations.Test;
1310

@@ -17,14 +14,6 @@
1714
@ContextConfiguration(classes = {EndpointConfig.class})
1815
public class UsingEnvironmentTestIT extends TestNGCitrusSpringSupport {
1916

20-
@Value("${apiManagerUser}")
21-
private String username;
22-
23-
@Value("${apiManagerPass}")
24-
private String password;
25-
26-
27-
2817
@CitrusTest(name = "UsingEnvironmentTestIT")
2918
@Test
3019
public void run() {
@@ -33,8 +22,6 @@ public void run() {
3322
variable("apiNumber", RandomNumberFunction.getRandomNumber(3, true));
3423
variable("apiPath", "/envrionment-stage-api-${apiNumber}");
3524
variable("apiName", "envrionment-stage-API-${apiNumber}");
36-
variable("oadminUsername1", username);
37-
variable("oadminPassword1", password);
3825

3926
$(echo("####### Importing API: '${apiName}' on path: '${apiPath}' for the first time #######"));
4027
variable(ImportTestAction.API_CONFIG, "/com/axway/apim/test/files/basic/minimal-config-with-api-definition.json");

modules/apis/src/test/java/com/axway/apim/test/security/UnpublishedApiKeyTestIT.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import org.citrusframework.message.MessageType;
99
import org.citrusframework.testng.spring.TestNGCitrusSpringSupport;
1010
import org.springframework.beans.factory.annotation.Autowired;
11-
import org.springframework.beans.factory.annotation.Value;
1211
import org.springframework.http.HttpStatus;
1312
import org.springframework.test.context.ContextConfiguration;
1413
import org.testng.annotations.Test;
@@ -24,11 +23,6 @@ public class UnpublishedApiKeyTestIT extends TestNGCitrusSpringSupport {
2423

2524
@Autowired
2625
HttpClient apiManager;
27-
@Value("${apiManagerUser}")
28-
private String username;
29-
30-
@Value("${apiManagerPass}")
31-
private String password;
3226

3327
@CitrusTest(name = "UnpublishedApiKeyTest")
3428
@Test
@@ -41,10 +35,6 @@ public void run() {
4135
variable("apiName", "API Key Test ${apiNumber}");
4236
variable("status", "unpublished");
4337

44-
// Directly use an admin-account, otherwise the OrgAdmin organization is used by default
45-
variable("oadminUsername1", username);
46-
variable("oadminPassword1", password);
47-
4838
$(echo("####### Importing API: '${apiName}' on path: '${apiPath}' with following settings: #######"));
4939
variable("apiKeyFieldName", "KeyId");
5040
variable("takeFrom", "HEADER");

0 commit comments

Comments
 (0)