Skip to content

Commit ebc5ec2

Browse files
committed
fix: get-subscription - various issues described below
* Controller needed @transactional. This did not show in the integration tests cos they already had @transactional wrapper on the @test which was a BAD IDEA * Database event_types needed to be an array i.e. varchar(128)p[]. Puzzled why this did not show on the integrations tests * Entity needs @Enumerated to ensure its saved as string. Might change this to database enum to avoid this * Lack of exception handler meant some logging was not showing. We not have a global handler to log everything and rethrow * Added the missing api-test which would have exhibited the error
1 parent 3c2dcdf commit ebc5ec2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/apiTest/java/uk/gov/hmcts/cp/subscription/http/SubscriptionApiTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ class SubscriptionApiTest {
2424

2525
@Test
2626
void round_trip_subscription_should_work_ok() throws InterruptedException {
27-
String postUrl = String.format("%s/client-subscriptions", baseUrl);
28-
HttpHeaders headers = new HttpHeaders();
27+
final String postUrl = java.lang.String.format("%s/client-subscriptions", baseUrl);
28+
final HttpHeaders headers = new HttpHeaders();
2929
headers.setContentType(MediaType.APPLICATION_JSON);
30-
String body = "{\"eventTypes\":[\"PCR\",\"CUSTODIAL_RESULT\"],\n" +
30+
final String body = "{\"eventTypes\":[\"PCR\",\"CUSTODIAL_RESULT\"],\n" +
3131
"\"notificationEndpoint\":{\"webhookUrl\":\"https://my-callback-url\"}}";
3232
final ResponseEntity<String> postResult = http.exchange(
3333
postUrl,
@@ -38,12 +38,12 @@ void round_trip_subscription_should_work_ok() throws InterruptedException {
3838
System.out.println("postResult:" + postResult);
3939
assertThat(postResult.getStatusCode()).isEqualTo(HttpStatus.CREATED);
4040
assertThat(postResult.getBody()).contains("clientSubscriptionId");
41-
String subscriptionId = postResult.getBody()
41+
final String subscriptionId = postResult.getBody()
4242
.replaceAll(".*clientSubscriptionId\":\"", "")
4343
.replaceAll("\".*$", "");
4444

4545
System.out.println("subscriptionId:" + subscriptionId);
46-
String getUrl = String.format("%s/client-subscriptions/%s", baseUrl, subscriptionId);
46+
final String getUrl = String.format("%s/client-subscriptions/%s", baseUrl, subscriptionId);
4747
final ResponseEntity<String> getResult = http.exchange(
4848
getUrl,
4949
HttpMethod.GET,

0 commit comments

Comments
 (0)