Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ThaminduR committed Oct 13, 2023
1 parent c8a4828 commit f07e325
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class APIResourceMgtEndpointConstants {
private APIResourceMgtEndpointConstants() {
}

public static final String API_RESOURCE_TYPE = "BUSINESS";
public static final String BUSINESS_API_RESOURCE_TYPE = "BUSINESS";
public static final String SYSTEM_API_RESOURCE_TYPE = "SYSTEM";
public static final String API_RESOURCE_MANAGEMENT_PREFIX = "API-RESOURCE-";
public static final String API_RESOURCE_PATH_COMPONENT = "/api-resources";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ private APIResource createAPIResource(APIResourceCreationModel apIResourceCreati
.scopes(createScopes(apIResourceCreationModel.getScopes()))
.requiresAuthorization(apIResourceCreationModel.getRequiresAuthorization() != null ?
apIResourceCreationModel.getRequiresAuthorization() : true)
.type(APIResourceMgtEndpointConstants.API_RESOURCE_TYPE);
.type(APIResourceMgtEndpointConstants.BUSINESS_API_RESOURCE_TYPE);
return apiResourceBuilder.build();
}

Expand Down Expand Up @@ -479,9 +479,9 @@ private static Integer validatedLimit(Integer limit) throws APIError {
*
* @param apiResource API resource to be handled.
*/
private static void handleSystemAPI(APIResource apiResource) {
private void handleSystemAPI(APIResource apiResource) {

if (StringUtils.equals(apiResource.getType(), APIResourceMgtEndpointConstants.SYSTEM_API_RESOURCE_TYPE)) {
if (APIResourceMgtEndpointConstants.SYSTEM_API_RESOURCE_TYPE.equals(apiResource.getType())) {
throw APIResourceMgtEndpointUtil.handleException(Response.Status.FORBIDDEN,
ErrorMessage.ERROR_CODE_SYSTEM_API_RESOURCE_NOT_MODIFIABLE);
}
Expand Down

0 comments on commit f07e325

Please sign in to comment.