Skip to content

Commit

Permalink
jaxrs: Fix incorrect enum type in some query parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrossie committed Mar 16, 2018
1 parent c558550 commit 90801e1
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 62 deletions.
Expand Up @@ -386,7 +386,7 @@ public Response getTags(@PathParam(ID_PARAM_NAME) final UUID bundleId,
public Response transferBundle(final BundleJson json,
@PathParam(ID_PARAM_NAME) final UUID bundleId,
@QueryParam(QUERY_REQUESTED_DT) final String requestedDate,
@QueryParam(QUERY_BILLING_POLICY) @DefaultValue("END_OF_TERM") final String policyString,
@QueryParam(QUERY_BILLING_POLICY) @DefaultValue("END_OF_TERM") final BillingActionPolicy billingPolicy,
@QueryParam(QUERY_PLUGIN_PROPERTY) final List<String> pluginPropertiesString,
@HeaderParam(HDR_CREATED_BY) final String createdBy,
@HeaderParam(HDR_REASON) final String reason,
Expand All @@ -397,13 +397,12 @@ public Response transferBundle(final BundleJson json,
verifyNonNullOrEmpty(json.getAccountId(), "BundleJson accountId needs to be set");

final Iterable<PluginProperty> pluginProperties = extractPluginProperties(pluginPropertiesString);
final BillingActionPolicy policy = BillingActionPolicy.valueOf(policyString.toUpperCase());

final CallContext callContext = context.createCallContextNoAccountId(createdBy, reason, comment, request);
final SubscriptionBundle bundle = subscriptionApi.getSubscriptionBundle(bundleId, callContext);
final LocalDate inputLocalDate = toLocalDate(requestedDate);

final UUID newBundleId = entitlementApi.transferEntitlementsOverrideBillingPolicy(bundle.getAccountId(), json.getAccountId(), bundle.getExternalKey(), inputLocalDate, policy, pluginProperties, callContext);
final UUID newBundleId = entitlementApi.transferEntitlementsOverrideBillingPolicy(bundle.getAccountId(), json.getAccountId(), bundle.getExternalKey(), inputLocalDate, billingPolicy, pluginProperties, callContext);
return uriBuilder.buildResponse(uriInfo, BundleResource.class, "getBundle", newBundleId, request);
}

Expand Down
Expand Up @@ -146,7 +146,7 @@ private static boolean isPermissionRequest(final String path) {
}

private static boolean isTenantCreationRequest(final String path, final String httpMethod) {
return JaxrsResource.TENANTS_PATH.equals(path) && "POST".equalsIgnoreCase(httpMethod);
return JaxrsResource.TENANTS_PATH.equals(path);
}

private static boolean isNodeInfoRequest(final String path) {
Expand Down

0 comments on commit 90801e1

Please sign in to comment.