Skip to content

Commit

Permalink
Fixing test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
HiranyaKavishani committed Oct 18, 2023
1 parent 6e3b934 commit 7402150
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,8 @@ public void testAddGetApplicationByNameWithUserNameNullGroupIdNull() throws Exce

}
@Test
public void testKeyForwardCompatibility() throws Exception {
public void testKeyForwardCompatibilityWhenNewAPIVersion() throws Exception {
List<API> oldApiVersionList = new ArrayList<>();
List<APIProduct> oldApiProductVersionList = new ArrayList<>();
API apiOld = new API(new APIIdentifier("SUMEDHA", "API1", "V1.0.0"));
oldApiVersionList.add(apiOld);

Expand All @@ -377,7 +376,7 @@ public void testKeyForwardCompatibility() throws Exception {
api.setUUID(UUID.randomUUID().toString());
api.getId().setId(apiMgtDAO.addAPI(api, -1234, "testOrg"));
ApiTypeWrapper apiTypeWrapper = new ApiTypeWrapper(api);
apiMgtDAO.makeKeysForwardCompatible(apiTypeWrapper, oldApiVersionList, oldApiProductVersionList);
apiMgtDAO.makeKeysForwardCompatibleForNewAPIVersion(apiTypeWrapper, oldApiVersionList);
}

@Test
Expand Down Expand Up @@ -422,7 +421,7 @@ public void testForwardingBlockedAndProdOnlyBlockedSubscriptionsToNewAPIVersion(
List<APIProduct> oldApiProductVersionList = new ArrayList<>();

ApiTypeWrapper apiTypeWrapper2 = new ApiTypeWrapper(api2);
apiMgtDAO.makeKeysForwardCompatible(apiTypeWrapper2, oldApiVersionList, oldApiProductVersionList);
apiMgtDAO.makeKeysForwardCompatibleForNewAPIVersion(apiTypeWrapper2, oldApiVersionList);

List<SubscribedAPI> subscriptionsOfAPI2 =
apiMgtDAO.getSubscriptionsOfAPI(apiId2.getApiName(), "V2.0.0", apiId2.getProviderName());
Expand All @@ -435,7 +434,8 @@ public void testForwardingBlockedAndProdOnlyBlockedSubscriptionsToNewAPIVersion(
"testOrg");

// Add the third version of the API
APIIdentifier apiId3 = new APIIdentifier("subForwardProvider", "SubForwardTestAPI", "V3.0.0");
APIIdentifier apiId3 = new APIIdentifier("subForwardProvider", "SubForwardTestAPI",
"V3.0.0");
API api3 = new API(apiId3);
api3.setContext("/context1");
api3.setContextTemplate("/context1/{version}");
Expand All @@ -445,8 +445,7 @@ public void testForwardingBlockedAndProdOnlyBlockedSubscriptionsToNewAPIVersion(
oldApiVersionList.add(api2);
ApiTypeWrapper apiTypeWrapper3 = new ApiTypeWrapper(api3);

apiMgtDAO.makeKeysForwardCompatible(apiTypeWrapper3, oldApiVersionList, oldApiProductVersionList);

apiMgtDAO.makeKeysForwardCompatibleForNewAPIVersion(apiTypeWrapper3, oldApiVersionList);
List<SubscribedAPI> subscriptionsOfAPI3 =
apiMgtDAO.getSubscriptionsOfAPI(apiId1.getApiName(), "V3.0.0", apiId1.getProviderName());
assertEquals(1, subscriptionsOfAPI3.size());
Expand Down

0 comments on commit 7402150

Please sign in to comment.