Skip to content

Commit

Permalink
Fixing testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
HiranyaKavishani committed Oct 5, 2023
1 parent b8a2bba commit d2b2889
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ public void testAddGetApplicationByNameWithUserNameNullGroupIdNull() throws Exce
@Test
public void testKeyForwardCompatibility() 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 @@ -376,7 +377,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);
apiMgtDAO.makeKeysForwardCompatible(apiTypeWrapper, oldApiVersionList, oldApiProductVersionList);
}

@Test
Expand Down Expand Up @@ -418,8 +419,10 @@ public void testForwardingBlockedAndProdOnlyBlockedSubscriptionsToNewAPIVersion(
// once API v2.0.0 is added, v1.0.0 becomes an older version hence add it to oldApiVersionList
oldApiVersionList.add(api);

List<APIProduct> oldApiProductVersionList = new ArrayList<>();

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

List<SubscribedAPI> subscriptionsOfAPI2 =
apiMgtDAO.getSubscriptionsOfAPI(apiId2.getApiName(), "V2.0.0", apiId2.getProviderName());
Expand All @@ -442,7 +445,7 @@ public void testForwardingBlockedAndProdOnlyBlockedSubscriptionsToNewAPIVersion(
oldApiVersionList.add(api2);
ApiTypeWrapper apiTypeWrapper3 = new ApiTypeWrapper(api3);

apiMgtDAO.makeKeysForwardCompatible(apiTypeWrapper3, oldApiVersionList);
apiMgtDAO.makeKeysForwardCompatible(apiTypeWrapper3, oldApiVersionList, oldApiProductVersionList);

List<SubscribedAPI> subscriptionsOfAPI3 =
apiMgtDAO.getSubscriptionsOfAPI(apiId1.getApiName(), "V3.0.0", apiId1.getProviderName());
Expand Down

0 comments on commit d2b2889

Please sign in to comment.