Skip to content

Commit

Permalink
- Fix junit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rathnapandi committed Sep 15, 2023
1 parent 284e06c commit aebc83c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -517,11 +517,11 @@ public RestAPICall createUpsertUri(HttpEntity entity, URI uri, ClientApplication
}

public void saveQuota(ClientApplication app, ClientApplication actualApp) throws AppException {
if (app != null & actualApp != null && app.getAppQuota().equals(actualApp.getAppQuota()))
if (app != null & actualApp != null && app.getAppQuota() != null && actualApp.getAppQuota() != null && app.getAppQuota().equals(actualApp.getAppQuota()))
return;
try {
URI uri = new URIBuilder(cmd.getAPIManagerURL()).setPath(cmd.getApiBasepath() + APPLICATIONS + "/" + app.getId() + "/quota").build();
if (app.getAppQuota().getRestrictions().isEmpty()) {
if (app.getAppQuota() != null && app.getAppQuota().getRestrictions().isEmpty()) {
// If source is empty and target has values, remove target to match source
deleteApplicationQuota(uri);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ public void saveQuota(){

ClientApplication clientApplicationExisting = new ClientApplication();
clientApplicationExisting.setName("test");
clientApplicationNew.setId(UUID.randomUUID().toString());
try {
appAdapter.saveQuota(clientApplicationNew, clientApplicationExisting);
} catch (AppException e) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"request": {
"method": "POST",
"urlPathPattern": "/api/portal/v1.4/applications/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/quota"
},
"response": {
"status": 200,
"bodyFileName": "quotas_application.json",
"headers": {
"Content-Type": "application/json"
}
}
}

0 comments on commit aebc83c

Please sign in to comment.