Skip to content

Commit

Permalink
jaxrs, profile: Re-enable (some more) profile tests for swagger gener…
Browse files Browse the repository at this point in the history
…ated client
  • Loading branch information
sbrossie committed Mar 28, 2018
1 parent af6a295 commit 5c0c54c
Show file tree
Hide file tree
Showing 26 changed files with 359 additions and 396 deletions.
Expand Up @@ -23,11 +23,14 @@


import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;


@ApiModel(value="ComboHostedPaymentPage") @ApiModel(value="ComboHostedPaymentPage")
public class ComboHostedPaymentPageJson extends ComboPaymentJson { public class ComboHostedPaymentPageJson extends ComboPaymentJson {


//@ApiModelProperty(name = required = true)
private final HostedPaymentPageFieldsJson hostedPaymentPageFields; private final HostedPaymentPageFieldsJson hostedPaymentPageFields;


@JsonCreator @JsonCreator
Expand All @@ -40,7 +43,7 @@ public ComboHostedPaymentPageJson(@JsonProperty("account") final AccountJson acc
this.hostedPaymentPageFields = hostedPaymentPageFields; this.hostedPaymentPageFields = hostedPaymentPageFields;
} }


public HostedPaymentPageFieldsJson getHostedPaymentPageFieldsJson() { public HostedPaymentPageFieldsJson getHostedPaymentPageFields() {
return hostedPaymentPageFields; return hostedPaymentPageFields;
} }


Expand Down
Expand Up @@ -23,17 +23,18 @@
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;




@ApiModel(value="HostedPaymentPageFields", parent = JsonBase.class) @ApiModel(value="HostedPaymentPageFields")
public class HostedPaymentPageFieldsJson extends JsonBase { public class HostedPaymentPageFieldsJson {


private final List<PluginPropertyJson> formFields; private final List<PluginPropertyJson> formFields;



@JsonCreator @JsonCreator
public HostedPaymentPageFieldsJson(@JsonProperty("formFields") final List<PluginPropertyJson> formFields) { public HostedPaymentPageFieldsJson(@JsonProperty("formFields") final List<PluginPropertyJson> formFields) {
this.formFields = formFields; this.formFields = formFields;
} }


public List<PluginPropertyJson> getCustomFields() { public List<PluginPropertyJson> getFormFields() {
return formFields; return formFields;
} }


Expand Down
Expand Up @@ -1232,7 +1232,7 @@ public Response modifyCustomFields(@PathParam(ID_PARAM_NAME) final UUID accountI
@ApiOperation(value = "Remove custom fields from account") @ApiOperation(value = "Remove custom fields from account")
@ApiResponses(value = {@ApiResponse(code = 400, message = "Invalid account id supplied")}) @ApiResponses(value = {@ApiResponse(code = 400, message = "Invalid account id supplied")})
public Response deleteCustomFields(@PathParam(ID_PARAM_NAME) final UUID accountId, public Response deleteCustomFields(@PathParam(ID_PARAM_NAME) final UUID accountId,
@QueryParam(QUERY_CUSTOM_FIELD) final List<String> customFieldList, @QueryParam(QUERY_CUSTOM_FIELD) final List<UUID> customFieldList,
@HeaderParam(HDR_CREATED_BY) final String createdBy, @HeaderParam(HDR_CREATED_BY) final String createdBy,
@HeaderParam(HDR_REASON) final String reason, @HeaderParam(HDR_REASON) final String reason,
@HeaderParam(HDR_COMMENT) final String comment, @HeaderParam(HDR_COMMENT) final String comment,
Expand Down
Expand Up @@ -372,8 +372,7 @@ public Response invalidatesCacheByAccount(@PathParam("accountId") final UUID acc
@Produces(APPLICATION_JSON) @Produces(APPLICATION_JSON)
@ApiOperation(value = "Invalidates Caches per tenant level") @ApiOperation(value = "Invalidates Caches per tenant level")
@ApiResponses(value = {}) @ApiResponses(value = {})
public Response invalidatesCacheByTenant(@QueryParam("tenantApiKey") final String tenantApiKey, public Response invalidatesCacheByTenant(@javax.ws.rs.core.Context final HttpServletRequest request) throws TenantApiException {
@javax.ws.rs.core.Context final HttpServletRequest request) throws TenantApiException {


// creating Tenant Context from Request // creating Tenant Context from Request
final TenantContext tenantContext = context.createTenantContextNoAccountId(request); final TenantContext tenantContext = context.createTenantContextNoAccountId(request);
Expand Down
Expand Up @@ -350,7 +350,7 @@ public Response modifyCustomFields(@PathParam(ID_PARAM_NAME) final UUID bundleId
@ApiOperation(value = "Remove custom fields from bundle") @ApiOperation(value = "Remove custom fields from bundle")
@ApiResponses(value = {@ApiResponse(code = 400, message = "Invalid bundle id supplied")}) @ApiResponses(value = {@ApiResponse(code = 400, message = "Invalid bundle id supplied")})
public Response deleteCustomFields(@PathParam(ID_PARAM_NAME) final UUID bundleId, public Response deleteCustomFields(@PathParam(ID_PARAM_NAME) final UUID bundleId,
@QueryParam(QUERY_CUSTOM_FIELD) final List<String> customFieldList, @QueryParam(QUERY_CUSTOM_FIELD) final List<UUID> customFieldList,
@HeaderParam(HDR_CREATED_BY) final String createdBy, @HeaderParam(HDR_CREATED_BY) final String createdBy,
@HeaderParam(HDR_REASON) final String reason, @HeaderParam(HDR_REASON) final String reason,
@HeaderParam(HDR_COMMENT) final String comment, @HeaderParam(HDR_COMMENT) final String comment,
Expand Down
Expand Up @@ -134,7 +134,7 @@ public Response modifyCustomFields(@PathParam(ID_PARAM_NAME) final UUID id,
@ApiOperation(value = "Remove custom fields from invoice item") @ApiOperation(value = "Remove custom fields from invoice item")
@ApiResponses(value = {@ApiResponse(code = 400, message = "Invalid invoice item id supplied")}) @ApiResponses(value = {@ApiResponse(code = 400, message = "Invalid invoice item id supplied")})
public Response deleteCustomFields(@PathParam(ID_PARAM_NAME) final UUID id, public Response deleteCustomFields(@PathParam(ID_PARAM_NAME) final UUID id,
@QueryParam(QUERY_CUSTOM_FIELD) final List<String> customFieldList, @QueryParam(QUERY_CUSTOM_FIELD) final List<UUID> customFieldList,
@HeaderParam(HDR_CREATED_BY) final String createdBy, @HeaderParam(HDR_CREATED_BY) final String createdBy,
@HeaderParam(HDR_REASON) final String reason, @HeaderParam(HDR_REASON) final String reason,
@HeaderParam(HDR_COMMENT) final String comment, @HeaderParam(HDR_COMMENT) final String comment,
Expand Down
Expand Up @@ -368,7 +368,7 @@ public Response modifyCustomFields(@PathParam(ID_PARAM_NAME) final UUID id,
@ApiOperation(value = "Remove custom fields from payment") @ApiOperation(value = "Remove custom fields from payment")
@ApiResponses(value = {@ApiResponse(code = 400, message = "Invalid payment id supplied")}) @ApiResponses(value = {@ApiResponse(code = 400, message = "Invalid payment id supplied")})
public Response deleteCustomFields(@PathParam(ID_PARAM_NAME) final UUID id, public Response deleteCustomFields(@PathParam(ID_PARAM_NAME) final UUID id,
@QueryParam(QUERY_CUSTOM_FIELD) final List<String> customFieldList, @QueryParam(QUERY_CUSTOM_FIELD) final List<UUID> customFieldList,
@HeaderParam(HDR_CREATED_BY) final String createdBy, @HeaderParam(HDR_CREATED_BY) final String createdBy,
@HeaderParam(HDR_REASON) final String reason, @HeaderParam(HDR_REASON) final String reason,
@HeaderParam(HDR_COMMENT) final String comment, @HeaderParam(HDR_COMMENT) final String comment,
Expand Down
Expand Up @@ -924,7 +924,7 @@ public Response modifyCustomFields(@PathParam(ID_PARAM_NAME) final UUID id,
@ApiOperation(value = "Remove custom fields from invoice") @ApiOperation(value = "Remove custom fields from invoice")
@ApiResponses(value = {@ApiResponse(code = 400, message = "Invalid invoice id supplied")}) @ApiResponses(value = {@ApiResponse(code = 400, message = "Invalid invoice id supplied")})
public Response deleteCustomFields(@PathParam(ID_PARAM_NAME) final UUID id, public Response deleteCustomFields(@PathParam(ID_PARAM_NAME) final UUID id,
@QueryParam(QUERY_CUSTOM_FIELD) final List<String> customFieldList, @QueryParam(QUERY_CUSTOM_FIELD) final List<UUID> customFieldList,
@HeaderParam(HDR_CREATED_BY) final String createdBy, @HeaderParam(HDR_CREATED_BY) final String createdBy,
@HeaderParam(HDR_REASON) final String reason, @HeaderParam(HDR_REASON) final String reason,
@HeaderParam(HDR_COMMENT) final String comment, @HeaderParam(HDR_COMMENT) final String comment,
Expand Down
Expand Up @@ -286,7 +286,7 @@ protected Response modifyCustomFields(final UUID id,
* @throws CustomFieldApiException * @throws CustomFieldApiException
*/ */
protected Response deleteCustomFields(final UUID id, protected Response deleteCustomFields(final UUID id,
final List<String> customFieldList, final List<UUID> customFieldList,
final CallContext context) throws CustomFieldApiException { final CallContext context) throws CustomFieldApiException {


// Retrieve all the custom fields for the object // Retrieve all the custom fields for the object
Expand All @@ -299,8 +299,7 @@ public boolean apply(final CustomField input) {
if (customFieldList.isEmpty()) { if (customFieldList.isEmpty()) {
return true; return true;
} }
for (final String cur : customFieldList) { for (final UUID curId : customFieldList) {
final UUID curId = UUID.fromString(cur);
if (input.getId().equals(curId)) { if (input.getId().equals(curId)) {
return true; return true;
} }
Expand Down
Expand Up @@ -112,8 +112,8 @@ public Response buildComboFormDescriptor(final ComboHostedPaymentPageJson json,
final Iterable<PluginProperty> paymentMethodPluginProperties = extractPluginProperties(json.getPaymentMethodPluginProperties()); final Iterable<PluginProperty> paymentMethodPluginProperties = extractPluginProperties(json.getPaymentMethodPluginProperties());
final UUID paymentMethodId = getOrCreatePaymentMethod(account, json.getPaymentMethod(), paymentMethodPluginProperties, callContext); final UUID paymentMethodId = getOrCreatePaymentMethod(account, json.getPaymentMethod(), paymentMethodPluginProperties, callContext);


final HostedPaymentPageFieldsJson hostedPaymentPageFields = json.getHostedPaymentPageFieldsJson(); final HostedPaymentPageFieldsJson hostedPaymentPageFields = json.getHostedPaymentPageFields();
final Iterable<PluginProperty> customFields = extractPluginProperties(hostedPaymentPageFields != null ? hostedPaymentPageFields.getCustomFields() : null); final Iterable<PluginProperty> customFields = extractPluginProperties(hostedPaymentPageFields != null ? hostedPaymentPageFields.getFormFields() : null);


final HostedPaymentPageFormDescriptor descriptor = paymentGatewayApi.buildFormDescriptorWithPaymentControl(account, paymentMethodId, customFields, pluginProperties, paymentOptions, callContext); final HostedPaymentPageFormDescriptor descriptor = paymentGatewayApi.buildFormDescriptorWithPaymentControl(account, paymentMethodId, customFields, pluginProperties, paymentOptions, callContext);
final HostedPaymentPageFormDescriptorJson result = new HostedPaymentPageFormDescriptorJson(descriptor); final HostedPaymentPageFormDescriptorJson result = new HostedPaymentPageFormDescriptorJson(descriptor);
Expand Down Expand Up @@ -147,7 +147,7 @@ public Response buildFormDescriptor(final HostedPaymentPageFieldsJson json,


validatePaymentMethodForAccount(accountId, paymentMethodId, callContext); validatePaymentMethodForAccount(accountId, paymentMethodId, callContext);


final Iterable<PluginProperty> customFields = extractPluginProperties(json.getCustomFields()); final Iterable<PluginProperty> customFields = extractPluginProperties(json.getFormFields());


final HostedPaymentPageFormDescriptor descriptor = paymentGatewayApi.buildFormDescriptorWithPaymentControl(account, paymentMethodId, customFields, pluginProperties, paymentOptions, callContext); final HostedPaymentPageFormDescriptor descriptor = paymentGatewayApi.buildFormDescriptorWithPaymentControl(account, paymentMethodId, customFields, pluginProperties, paymentOptions, callContext);
final HostedPaymentPageFormDescriptorJson result = new HostedPaymentPageFormDescriptorJson(descriptor); final HostedPaymentPageFormDescriptorJson result = new HostedPaymentPageFormDescriptorJson(descriptor);
Expand All @@ -160,7 +160,7 @@ public Response buildFormDescriptor(final HostedPaymentPageFieldsJson json,
@Path("/" + NOTIFICATION + "/{" + QUERY_PAYMENT_PLUGIN_NAME + ":" + ANYTHING_PATTERN + "}") @Path("/" + NOTIFICATION + "/{" + QUERY_PAYMENT_PLUGIN_NAME + ":" + ANYTHING_PATTERN + "}")
@Consumes(WILDCARD) @Consumes(WILDCARD)
@Produces(APPLICATION_JSON) @Produces(APPLICATION_JSON)
@ApiOperation(value = "Process a gateway notification", notes = "The response is built by the appropriate plugin", response = GatewayNotificationJson.class) @ApiOperation(value = "Process a gateway notification", notes = "The response is built by the appropriate plugin")
@ApiResponses(value = {}) @ApiResponses(value = {})
public Response processNotification(final String body, public Response processNotification(final String body,
@PathParam(PATH_PAYMENT_PLUGIN_NAME) final String pluginName, @PathParam(PATH_PAYMENT_PLUGIN_NAME) final String pluginName,
Expand Down
Expand Up @@ -338,7 +338,7 @@ public Response modifyCustomFields(@PathParam("paymentMethodId") final UUID paym
@ApiOperation(value = "Remove custom fields from payment method") @ApiOperation(value = "Remove custom fields from payment method")
@ApiResponses(value = {@ApiResponse(code = 400, message = "Invalid payment method id supplied")}) @ApiResponses(value = {@ApiResponse(code = 400, message = "Invalid payment method id supplied")})
public Response deleteCustomFields(@PathParam("paymentMethodId") final UUID paymentMethodId, public Response deleteCustomFields(@PathParam("paymentMethodId") final UUID paymentMethodId,
@QueryParam(QUERY_CUSTOM_FIELD) final List<String> customFieldList, @QueryParam(QUERY_CUSTOM_FIELD) final List<UUID> customFieldList,
@HeaderParam(HDR_CREATED_BY) final String createdBy, @HeaderParam(HDR_CREATED_BY) final String createdBy,
@HeaderParam(HDR_REASON) final String reason, @HeaderParam(HDR_REASON) final String reason,
@HeaderParam(HDR_COMMENT) final String comment, @HeaderParam(HDR_COMMENT) final String comment,
Expand Down
Expand Up @@ -837,7 +837,7 @@ public Response modifyCustomFields(@PathParam(ID_PARAM_NAME) final UUID id,
@ApiOperation(value = "Remove custom fields from payment payment") @ApiOperation(value = "Remove custom fields from payment payment")
@ApiResponses(value = {@ApiResponse(code = 400, message = "Invalid payment id supplied")}) @ApiResponses(value = {@ApiResponse(code = 400, message = "Invalid payment id supplied")})
public Response deleteCustomFields(@PathParam(ID_PARAM_NAME) final UUID id, public Response deleteCustomFields(@PathParam(ID_PARAM_NAME) final UUID id,
@QueryParam(QUERY_CUSTOM_FIELD) final List<String> customFieldList, @QueryParam(QUERY_CUSTOM_FIELD) final List<UUID> customFieldList,
@HeaderParam(HDR_CREATED_BY) final String createdBy, @HeaderParam(HDR_CREATED_BY) final String createdBy,
@HeaderParam(HDR_REASON) final String reason, @HeaderParam(HDR_REASON) final String reason,
@HeaderParam(HDR_COMMENT) final String comment, @HeaderParam(HDR_COMMENT) final String comment,
Expand Down
Expand Up @@ -908,7 +908,7 @@ public Response modifyCustomFields(@PathParam(ID_PARAM_NAME) final UUID id,
@ApiOperation(value = "Remove custom fields from subscription") @ApiOperation(value = "Remove custom fields from subscription")
@ApiResponses(value = {@ApiResponse(code = 400, message = "Invalid subscription id supplied")}) @ApiResponses(value = {@ApiResponse(code = 400, message = "Invalid subscription id supplied")})
public Response deleteCustomFields(@PathParam(ID_PARAM_NAME) final UUID id, public Response deleteCustomFields(@PathParam(ID_PARAM_NAME) final UUID id,
@QueryParam(QUERY_CUSTOM_FIELD) final List<String> customFieldList, @QueryParam(QUERY_CUSTOM_FIELD) final List<UUID> customFieldList,
@HeaderParam(HDR_CREATED_BY) final String createdBy, @HeaderParam(HDR_CREATED_BY) final String createdBy,
@HeaderParam(HDR_REASON) final String reason, @HeaderParam(HDR_REASON) final String reason,
@HeaderParam(HDR_COMMENT) final String comment, @HeaderParam(HDR_COMMENT) final String comment,
Expand Down
Expand Up @@ -202,7 +202,7 @@ public Response modifyCustomFields(@PathParam(ID_PARAM_NAME) final UUID id,
@ApiOperation(value = "Remove custom fields from payment transaction") @ApiOperation(value = "Remove custom fields from payment transaction")
@ApiResponses(value = {@ApiResponse(code = 400, message = "Invalid transaction id supplied")}) @ApiResponses(value = {@ApiResponse(code = 400, message = "Invalid transaction id supplied")})
public Response deleteCustomFields(@PathParam(ID_PARAM_NAME) final UUID id, public Response deleteCustomFields(@PathParam(ID_PARAM_NAME) final UUID id,
@QueryParam(QUERY_CUSTOM_FIELD) final List<String> customFieldList, @QueryParam(QUERY_CUSTOM_FIELD) final List<UUID> customFieldList,
@HeaderParam(HDR_CREATED_BY) final String createdBy, @HeaderParam(HDR_CREATED_BY) final String createdBy,
@HeaderParam(HDR_REASON) final String reason, @HeaderParam(HDR_REASON) final String reason,
@HeaderParam(HDR_COMMENT) final String comment, @HeaderParam(HDR_COMMENT) final String comment,
Expand Down

0 comments on commit 5c0c54c

Please sign in to comment.