Skip to content

Commit e8bc232

Browse files
author
Chris Wiechmann
authored
Merge pull request #51 from Axway-API-Management-Plus/develop
Prepare to release 1.2.1
2 parents 4e77cca + eb6acbb commit e8bc232

3 files changed

Lines changed: 18 additions & 7 deletions

File tree

modules/apim-adapter/src/main/java/com/axway/apim/adapter/apis/APIManagerAPIAdapter.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
import com.axway.apim.api.model.APIQuota;
5252
import com.axway.apim.api.model.Image;
5353
import com.axway.apim.api.model.Organization;
54+
import com.axway.apim.api.model.OutboundProfile;
5455
import com.axway.apim.api.model.Profile;
5556
import com.axway.apim.api.model.QuotaRestriction;
5657
import com.axway.apim.api.model.apps.ClientApplication;
@@ -352,9 +353,15 @@ private <ProfileType> void _translateMethodIds(Map<String, ProfileType> profiles
352353
}
353354
ProfileType profileWithType = profiles.get(key);
354355
Profile profile = (Profile)profileWithType;
355-
profile.setApiMethodId(method.getId());
356-
profile.setApiMethodName(method.getName());
357-
profile.setApiId(method.getVirtualizedApiId());
356+
if(profile instanceof OutboundProfile) {
357+
profile.setApiMethodId(method.getApiMethodId());
358+
profile.setApiMethodName(method.getName());
359+
profile.setApiId(method.getApiId());
360+
} else {
361+
profile.setApiMethodId(method.getId());
362+
profile.setApiMethodName(method.getName());
363+
profile.setApiId(method.getVirtualizedApiId());
364+
}
358365
if(mode==METHOD_TRANSLATION.AS_NAME) {
359366
updatedEntries.put(method.getName(), profileWithType);
360367
} else {

modules/apim-adapter/src/test/java/com/axway/apim/adapter/apis/APIManagerAPIAdapterSet1Test.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ public void testTranslateMethodToName() throws AppException, IOException {
5151
Map<String, OutboundProfile> outboundProfiles = api.getOutboundProfiles();
5252
Assert.assertNotNull(outboundProfiles.get("_default"), "Expected to find default outbound profile");
5353
Assert.assertNotNull(outboundProfiles.get("deletePet").getApiMethodId(), "deletePet");
54-
Assert.assertEquals(outboundProfiles.get("deletePet").getApiId(), "72745ed9-f75b-428c-959c-b483eea497a1");
55-
Assert.assertEquals(outboundProfiles.get("deletePet").getApiMethodId(), "132712e4-c132-4298-bfa0-f6f5c811ad65");
54+
Assert.assertEquals(outboundProfiles.get("deletePet").getApiId(), "10f02b84-fa4a-4cb6-a0c9-da6974c77005");
55+
Assert.assertEquals(outboundProfiles.get("deletePet").getApiMethodId(), "db89e373-f678-4990-88ca-891e434c34db");
5656
Assert.assertEquals(outboundProfiles.get("deletePet").getApiMethodName(), "deletePet");
5757

5858
Assert.assertEquals(api.getInboundProfiles().size(), 2);

modules/apis/src/test/java/com/axway/apim/test/methodLevel/OutboundMethodLevelTestIT.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,19 @@ public void run(@Optional @CitrusResource TestContext context) throws IOExceptio
4545
.validate("$.[?(@.path=='${apiPath}')].name", "${apiName}")
4646
.validate("$.[?(@.path=='${apiPath}')].state", "${state}")
4747
.validate("$.[?(@.path=='${apiPath}')].authenticationProfiles[?(@.name=='${outboundProfileName}')].type", "http_basic")
48-
.extractFromPayload("$.[?(@.path=='${apiPath}')].id", "apiId"));
48+
.extractFromPayload("$.[?(@.path=='${apiPath}')].id", "apiId")
49+
.extractFromPayload("$.[?(@.path=='${apiPath}')].apiId", "backendApiId")
50+
);
4951

5052
http(builder -> builder.client("apiManager").send().get("/proxies/${apiId}/operations").header("Content-Type", "application/json"));
5153
http(builder -> builder.client("apiManager").receive().response(HttpStatus.OK).messageType(MessageType.JSON)
5254
.extractFromPayload("$.[?(@.name=='getOrderById')].id", "apiMethodId"));
5355

5456
http(builder -> builder.client("apiManager").send().get("/proxies/${apiId}").header("Content-Type", "application/json"));
5557
http(builder -> builder.client("apiManager").receive().response(HttpStatus.OK).messageType(MessageType.JSON)
56-
.validate("$.[?(@.id=='${apiId}')].outboundProfiles.${apiMethodId}.authenticationProfile", "${outboundProfileName}"));
58+
.validate("$.[?(@.id=='${apiId}')].outboundProfiles.${apiMethodId}.authenticationProfile", "${outboundProfileName}")
59+
.validate("$.[?(@.id=='${apiId}')].outboundProfiles.${apiMethodId}.apiId", "${backendApiId}")
60+
);
5761

5862
echo("####### Perform a No-Change #######");
5963
createVariable(ImportTestAction.API_DEFINITION, "/com/axway/apim/test/files/basic/petstore.json");

0 commit comments

Comments
 (0)