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

added migration script and code changes for action and actionResultNa… #2069

Merged
merged 6 commits into from
Oct 10, 2023
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE "bie_contention_event"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note that right now, we'll have to re-deploy the vro-app with the latest db-init container to actually run these migration updates

ADD COLUMN "action_name" VARCHAR(255) DEFAULT NULL,
ADD COLUMN "action_result_name" VARCHAR(255) DEFAULT NULL;
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ void testSaveContentionEventRoute() {
assertThat(response.getContentionId()).isEqualTo(testItem.getContentionId());
assertThat(response.getContentionTypeCode()).isEqualTo(testItem.getContentionTypeCode());
assertThat(response.getDiagnosticTypeCode()).isEqualTo(testItem.getDiagnosticTypeCode());
assertThat(response.getActionName()).isEqualTo(testItem.getActionName());
assertThat(response.getActionResultName()).isEqualTo(testItem.getActionResultName());

assertMockEndpointsSatisfied();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public class BieMessagePayload {
private String contentionTypeCode;
private String contentionClassificationName;
private String diagnosticTypeCode;
private String actionName;
private String actionResultName;
private long notifiedAt;
private long occurredAt;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public static BieMessagePayload create() {
.diagnosticTypeCode(faker.lorem().characters(10))
.occurredAt(faker.date().past(60, TimeUnit.DAYS).getTime())
.notifiedAt(faker.date().past(60, TimeUnit.DAYS).getTime())
.actionName(faker.lorem().characters(10))
.actionResultName(faker.lorem().characters(10))
.status(200)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ private BieMessagePayload handleGenericRecord(ConsumerRecord<String, Object> rec
String KEY_CONTENTION_ID = "ContentionId";
String KEY_CONTENTION_TYPE_CODE = "ContentionTypeCode";
String KEY_EVENT_TIME = "EventTime";
String ACTION_NAME = "ActionName";
String ACTION_RESULT_NAME = "ActionResultName";

return BieMessagePayload.builder()
.eventType(
Expand All @@ -73,6 +75,8 @@ private BieMessagePayload handleGenericRecord(ConsumerRecord<String, Object> rec
.diagnosticTypeCode((String) messageValue.get(KEY_DIAGNOSTIC_TYPE_CODE))
.occurredAt((Long) messageValue.get(KEY_EVENT_TIME))
.notifiedAt(record.timestamp())
.actionName((String) messageValue.get(ACTION_NAME))
.actionResultName((String) messageValue.get(ACTION_RESULT_NAME))
.status(200)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ void shouldConvertAndSendBiePayload() {
.isEqualTo(payload.getContentionClassificationName());
assertThat(value.getDiagnosticTypeCode()).isEqualTo(payload.getDiagnosticTypeCode());
assertThat(value.getNotifiedAt()).isEqualTo(payload.getNotifiedAt());
assertThat(value.getActionName()).isEqualTo(payload.getActionName());
assertThat(value.getActionResultName()).isEqualTo(payload.getActionResultName());
}
}
}