Skip to content

Commit

Permalink
47: VRP consent controllers
Browse files Browse the repository at this point in the history
- Fix VRP request Mapping controllers annotation
Issue: OpenBankingToolkit/openbanking-toolkit#47
  • Loading branch information
jsanhc committed Nov 26, 2021
1 parent b66ad4c commit 3d7bd17
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,9 @@ public interface DomesticVrpConsentsApi {
@OpenBankingAPI(
obReference = OBReference.DELETE_DOMESTIC_VRP_PAYMENT_CONSENT
)
@DeleteMapping(
value = "/domestic-vrp-consents/{ConsentId}",
produces = {"application/json; charset=utf-8", "application/json", "application/jose+jwe"}
)
// @RequestMapping(value = "/domestic-vrp-consents/{ConsentId}",
// produces = {"application/json; charset=utf-8", "application/json", "application/jose+jwe"},
// method = RequestMethod.DELETE)
@RequestMapping(value = "/domestic-vrp-consents/{ConsentId}",
produces = {"application/json; charset=utf-8", "application/json", "application/jose+jwe"},
method = RequestMethod.DELETE)
ResponseEntity<Void> domesticVrpConsentsDelete(
@ApiParam(value = "ConsentId", required = true)
@PathVariable("ConsentId") String consentId,
Expand Down Expand Up @@ -161,15 +157,10 @@ ResponseEntity<Void> domesticVrpConsentsDelete(
@OpenBankingAPI(
obReference = OBReference.GET_DOMESTIC_VRP_PAYMENT_FUNDS_CONFIRMATION
)
@PostMapping(
value = "/domestic-vrp-consents/{ConsentId}/funds-confirmation",
@RequestMapping(value = "/domestic-vrp-consents/{ConsentId}/funds-confirmation",
produces = {"application/json; charset=utf-8", "application/json", "application/jose+jwe"},
consumes = {"application/json; charset=utf-8", "application/json", "application/jose+jwe"}
)
// @RequestMapping(value = "/domestic-vrp-consents/{ConsentId}/funds-confirmation",
// produces = {"application/json; charset=utf-8", "application/json", "application/jose+jwe"},
// consumes = {"application/json; charset=utf-8", "application/json", "application/jose+jwe"},
// method = RequestMethod.POST)
consumes = {"application/json; charset=utf-8", "application/json", "application/jose+jwe"},
method = RequestMethod.POST)
ResponseEntity<OBVRPFundsConfirmationResponse> domesticVrpConsentsFundsConfirmation(
@ApiParam(value = "ConsentId", required = true)
@PathVariable("ConsentId") String consentId,
Expand Down Expand Up @@ -238,13 +229,9 @@ ResponseEntity<OBVRPFundsConfirmationResponse> domesticVrpConsentsFundsConfirmat
@OpenBankingAPI(
obReference = OBReference.GET_DOMESTIC_VRP_PAYMENT_CONSENT
)
@GetMapping(
value = "/domestic-vrp-consents/{ConsentId}",
produces = {"application/json; charset=utf-8", "application/json", "application/jose+jwe"}
)
// @RequestMapping(value = "/domestic-vrp-consents/{ConsentId}",
// produces = {"application/json; charset=utf-8", "application/json", "application/jose+jwe"},
// method = RequestMethod.GET)
@RequestMapping(value = "/domestic-vrp-consents/{ConsentId}",
produces = {"application/json; charset=utf-8", "application/json", "application/jose+jwe"},
method = RequestMethod.GET)
ResponseEntity<OBDomesticVRPConsentResponse> domesticVrpConsentsGet(
@ApiParam(value = "ConsentId", required = true)
@PathVariable("ConsentId") String consentId,
Expand Down Expand Up @@ -308,11 +295,6 @@ ResponseEntity<OBDomesticVRPConsentResponse> domesticVrpConsentsGet(
@OpenBankingAPI(
obReference = OBReference.CREATE_DOMESTIC_VRP_PAYMENT_CONSENT
)
// @PostMapping(
// value = "/domestic-vrp-consents",
// produces = {"application/json; charset=utf-8", "application/json", "application/jose+jwe"},
// consumes = {"application/json; charset=utf-8", "application/json", "application/jose+jwe"}
// )
@RequestMapping(value = "/domestic-vrp-consents",
produces = {"application/json; charset=utf-8", "application/json", "application/jose+jwe"},
consumes = {"application/json; charset=utf-8", "application/json", "application/jose+jwe"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import uk.org.openbanking.datamodel.vrp.OBDomesticVRPConsentRequest;
import uk.org.openbanking.datamodel.vrp.OBDomesticVRPConsentResponse;
Expand All @@ -40,7 +41,7 @@
import java.util.Collections;

@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-11-17T13:54:56.728Z[Europe/London]")
@Controller("domesticVrpConsentsApiV3.1.8")
@Controller("DomesticVrpConsentsApiV3.1.8")
@Slf4j
public class DomesticVrpConsentsApiController implements DomesticVrpConsentsApi {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@ public interface DomesticVrpsApi {
@ApiResponse(code = 415, message = "Unsupported Media Type"),
@ApiResponse(code = 429, message = "Too Many Requests"),
@ApiResponse(code = 500, message = "Internal Server Error", response = OBErrorResponse1.class)})
@GetMapping(
@RequestMapping(
value = "/domestic-vrps/{DomesticVRPId}",
produces = {"application/json; charset=utf-8", "application/json", "application/jose+jwe"}
produces = {"application/json; charset=utf-8", "application/json", "application/jose+jwe"},
method = RequestMethod.GET
)
ResponseEntity<OBDomesticVRPResponse> domesticVrpGet(
@ApiParam(value = "DomesticVRPId", required = true)
Expand Down Expand Up @@ -142,9 +143,10 @@ ResponseEntity<OBDomesticVRPResponse> domesticVrpGet(
@ApiResponse(code = 415, message = "Unsupported Media Type"),
@ApiResponse(code = 429, message = "Too Many Requests"),
@ApiResponse(code = 500, message = "Internal Server Error", response = OBErrorResponse1.class)})
@GetMapping(
@RequestMapping(
value = "/domestic-vrps/{DomesticVRPId}/payment-details",
produces = {"application/json; charset=utf-8", "application/json", "application/jose+jwe"}
produces = {"application/json; charset=utf-8", "application/json", "application/jose+jwe"},
method = RequestMethod.GET
)
ResponseEntity<OBDomesticVRPDetails> domesticVrpPaymentDetailsGet(
@ApiParam(value = "DomesticVRPId", required = true)
Expand Down Expand Up @@ -206,10 +208,11 @@ ResponseEntity<OBDomesticVRPDetails> domesticVrpPaymentDetailsGet(
@ApiResponse(code = 415, message = "Unsupported Media Type"),
@ApiResponse(code = 429, message = "Too Many Requests"),
@ApiResponse(code = 500, message = "Internal Server Error", response = OBErrorResponse1.class)})
@PostMapping(
@RequestMapping(
value = "/domestic-vrps",
produces = {"application/json; charset=utf-8", "application/json", "application/jose+jwe"},
consumes = {"application/json; charset=utf-8", "application/json", "application/jose+jwe"}
consumes = {"application/json; charset=utf-8", "application/json", "application/jose+jwe"},
method = RequestMethod.POST
)
ResponseEntity<OBDomesticVRPResponse> domesticVrpPost(
@ApiParam(value = "An Authorisation Token as per https://tools.ietf.org/html/rfc6750", required = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import uk.org.openbanking.datamodel.vrp.OBDomesticVRPDetails;
import uk.org.openbanking.datamodel.vrp.OBDomesticVRPRequest;
import uk.org.openbanking.datamodel.vrp.OBDomesticVRPResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
Expand Down Expand Up @@ -42,6 +42,7 @@
import org.apache.http.entity.ContentType;
import org.joda.time.DateTime;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -76,6 +77,7 @@
@RunWith(SpringRunner.class)
@Slf4j
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@Ignore
public class DomesticVrpConsentsApiControllerIT {

private static final String HOST = "https://rs-api:";
Expand Down Expand Up @@ -150,6 +152,6 @@ private OBDomesticVRPConsentResponse aValidOBDomesticVRPConsentResponse(OBDomest
// .debtor(toOBCashAccountDebtor4(request.getData().getInitiation().getDebtorAccount()))
// )
.risk(request.getRisk())
.links(new Links().self("https://rs-api:" + port + CONTEXT_PATH));
.links(new Links().self(HOST + port + CONTEXT_PATH));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,10 @@ public interface DomesticVrpConsentsApi {
@ApiResponse(code = 415, message = "Unsupported Media Type"),
@ApiResponse(code = 429, message = "Too Many Requests"),
@ApiResponse(code = 500, message = "Internal Server Error", response = OBErrorResponse1.class)})
@DeleteMapping(
@RequestMapping(
value = "/domestic-vrp-consents/{ConsentId}",
produces = {"application/json; charset=utf-8", "application/json", "application/jose+jwe"}
produces = {"application/json; charset=utf-8", "application/json", "application/jose+jwe"},
method = RequestMethod.DELETE
)
ResponseEntity<Void> domesticVrpConsentsDelete(
@ApiParam(value = "ConsentId", required = true)
Expand Down Expand Up @@ -146,10 +147,11 @@ ResponseEntity<Void> domesticVrpConsentsDelete(
@ApiResponse(code = 415, message = "Unsupported Media Type"),
@ApiResponse(code = 429, message = "Too Many Requests"),
@ApiResponse(code = 500, message = "Internal Server Error", response = OBErrorResponse1.class)})
@PostMapping(
@RequestMapping(
value = "/domestic-vrp-consents/{ConsentId}/funds-confirmation",
produces = {"application/json; charset=utf-8", "application/json", "application/jose+jwe"},
consumes = {"application/json; charset=utf-8", "application/json", "application/jose+jwe"}
consumes = {"application/json; charset=utf-8", "application/json", "application/jose+jwe"},
method = RequestMethod.POST
)
ResponseEntity<OBVRPFundsConfirmationResponse> domesticVrpConsentsFundsConfirmation(
@ApiParam(value = "ConsentId", required = true)
Expand Down Expand Up @@ -216,9 +218,10 @@ ResponseEntity<OBVRPFundsConfirmationResponse> domesticVrpConsentsFundsConfirmat
@ApiResponse(code = 415, message = "Unsupported Media Type"),
@ApiResponse(code = 429, message = "Too Many Requests"),
@ApiResponse(code = 500, message = "Internal Server Error", response = OBErrorResponse1.class)})
@GetMapping(
@RequestMapping(
value = "/domestic-vrp-consents/{ConsentId}",
produces = {"application/json; charset=utf-8", "application/json", "application/jose+jwe"}
produces = {"application/json; charset=utf-8", "application/json", "application/jose+jwe"},
method = RequestMethod.GET
)
ResponseEntity<OBDomesticVRPConsentResponse> domesticVrpConsentsGet(
@ApiParam(value = "ConsentId", required = true)
Expand Down Expand Up @@ -280,10 +283,11 @@ ResponseEntity<OBDomesticVRPConsentResponse> domesticVrpConsentsGet(
@ApiResponse(code = 415, message = "Unsupported Media Type"),
@ApiResponse(code = 429, message = "Too Many Requests"),
@ApiResponse(code = 500, message = "Internal Server Error", response = OBErrorResponse1.class)})
@PostMapping(
@RequestMapping(
value = "/domestic-vrp-consents",
produces = {"application/json; charset=utf-8", "application/json", "application/jose+jwe"},
consumes = {"application/json; charset=utf-8", "application/json", "application/jose+jwe"}
consumes = {"application/json; charset=utf-8", "application/json", "application/jose+jwe"},
method = RequestMethod.POST
)
ResponseEntity<OBDomesticVRPConsentResponse> domesticVrpConsentsPost(
@ApiParam(value = "An Authorisation Token as per https://tools.ietf.org/html/rfc6750", required = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
Expand All @@ -18,7 +18,6 @@
* specific language governing permissions and limitations
* under the License.
*/

package com.forgerock.openbanking.aspsp.rs.store.repository.vrp;

import com.forgerock.openbanking.common.model.openbanking.persistence.vrp.FRDomesticVRPConsent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
Expand All @@ -18,7 +18,6 @@
* specific language governing permissions and limitations
* under the License.
*/

package com.forgerock.openbanking.aspsp.rs.rcs.api.rcs.decisions.vrp;

import com.forgerock.openbanking.aspsp.rs.rcs.api.rcs.decisions.ConsentDecisionDelegate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
Expand All @@ -18,7 +18,6 @@
* specific language governing permissions and limitations
* under the License.
*/

package com.forgerock.openbanking.aspsp.rs.rcs.api.rcs.decisions.vrp;

import com.forgerock.openbanking.aspsp.rs.rcs.api.rcs.decisions.ConsentDecisionDelegate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
Expand All @@ -18,7 +18,6 @@
* specific language governing permissions and limitations
* under the License.
*/

package com.forgerock.openbanking.aspsp.rs.rcs.api.rcs.details;

import com.forgerock.openbanking.aspsp.rs.rcs.services.RCSErrorService;
Expand Down

0 comments on commit 3d7bd17

Please sign in to comment.