Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix test #332

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/anchore-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Anchore Scan"

on:
push:
branches: [ main ]
branches: [ main, 'hotfix/**' ]
pull_request:
types: [ labeled, opened, reopened, synchronize ]
schedule:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: "CodeQL Scan"

on:
push:
branches: [ main ]
branches: [ main, 'hotfix/**' ]
pull_request:
branches: [ main ]
branches: [ main, 'hotfix/**' ]
schedule:
- cron: '45 12 * * 1'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

@SpringBootApplication
public class CaseCreatorApplication {

//test
public static void main(String[] args) {
SpringApplication.run(CaseCreatorApplication.class, args);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ CreateMigrationCorrespondentRequest composeMigrationCorrespondentRequest(
MigrationData migrationData
) {
MigrationComplaintCorrespondent primaryCorrespondent = getPrimaryCorrespondent(migrationData.getPrimaryCorrespondent());
List<MigrationComplaintCorrespondent> additionalCorrespondents = getAdditionalCorrespondents(migrationData.getAdditionalCorrespondents());
List<MigrationComplaintCorrespondent> additionalCorrespondents = getAdditionalCorrespondents(caseId, migrationData.getAdditionalCorrespondents());

return new CreateMigrationCorrespondentRequest(
caseId,
Expand Down Expand Up @@ -223,7 +223,7 @@ public MigrationComplaintCorrespondent getPrimaryCorrespondent(LinkedHashMap cor
return primaryCorrespondent;
}

public List<MigrationComplaintCorrespondent> getAdditionalCorrespondents(Optional<String> correspondentJson) {
public List<MigrationComplaintCorrespondent> getAdditionalCorrespondents(UUID caseId, Optional<String> correspondentJson) {
try {
List<MigrationComplaintCorrespondent> additionalCorrespondents = objectMapper.convertValue(
objectMapper.readValue(correspondentJson.get(), JSONArray.class),
Expand All @@ -232,6 +232,8 @@ public List<MigrationComplaintCorrespondent> getAdditionalCorrespondents(Optiona
);
return additionalCorrespondents;
} catch (Exception e) {
log.error("Failed to create additional correspondents for case id {}", caseId);
messageLogService.updateStatus(requestData.getCorrelationId(), Status.CASE_ADDITIONAL_CORRESPONDENTS_FAILED);
return Collections.emptyList();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
public enum Status {
CASE_CORRESPONDENTS_FAILED,
CASE_CORRESPONDENTS_HANDLED,
CASE_ADDITIONAL_CORRESPONDENTS_FAILED,
CASE_CREATED,
CASE_CREATION_FAILED,
CASE_DOCUMENT_CREATED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public void setUp() {
migrationData.getPrimaryCorrespondent());

List<MigrationComplaintCorrespondent> additionalCorrespondents = migrationService.getAdditionalCorrespondents(
UUID.randomUUID(),
migrationData.getAdditionalCorrespondents());

caseAttachment = new ArrayList<>();
Expand Down Expand Up @@ -229,6 +230,7 @@ public void shouldContainNoAdditionalCorrespondents() {

List<MigrationComplaintCorrespondent> migrationComplaintCorrespondents =
migrationService.getAdditionalCorrespondents(
UUID.randomUUID(),
migrationData.getAdditionalCorrespondents());

assertTrue(migrationComplaintCorrespondents.isEmpty());
Expand Down
Loading