Skip to content

Commit

Permalink
checkstyle fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JAndrewCH committed Jan 2, 2024
1 parent 3f849fa commit fdef200
Showing 1 changed file with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,23 +51,36 @@ public ApiResponse<Void> invokeChsKafkaApi(String contextId, String companyNumbe
return handleApiCall(changedResourcePost);
}

/**
* Creates a ChangedResource object to send a delete request to the chs kafka api.
*
* @param contextId chs kafka id
* @param companyNumber company number of psc
* @param notificationId mongo id
* @return passes request to api response handling
*/
@StreamEvents
public ApiResponse<Void> invokeChsKafkaApiWithDeleteEvent(String contextId, String companyNumber, String notificationId, String kind) {
public ApiResponse<Void> invokeChsKafkaApiWithDeleteEvent(String contextId,
String companyNumber,
String notificationId, String kind) {
internalApiClient.setBasePath(chsKafkaApiUrl);
PrivateChangedResourcePost changedResourcePost = internalApiClient.privateChangedResourceHandler()
.postChangedResource(resourceChangedUri, mapChangedResource(contextId, companyNumber, notificationId, kind, true));
PrivateChangedResourcePost changedResourcePost =
internalApiClient.privateChangedResourceHandler()
.postChangedResource(resourceChangedUri,
mapChangedResource(contextId, companyNumber,
notificationId, kind, true));
return handleApiCall(changedResourcePost);
}

private ChangedResource mapChangedResource(String contextId, String companyNumber,
String notificationId, String kind, boolean isDelete) {
String notificationId,
String kind, boolean isDelete) {
ChangedResourceEvent event = new ChangedResourceEvent();
ChangedResource changedResource = new ChangedResource();
event.setPublishedAt(String.valueOf(OffsetDateTime.now()));
if (isDelete) {
event.setType(DELETE_EVENT_TYPE);
}
else {
} else {
event.setType(CHANGED_EVENT_TYPE);
}
changedResource.setResourceUri(String.format(PSC_URI, companyNumber, notificationId));
Expand Down

0 comments on commit fdef200

Please sign in to comment.