GH-866 - Polishing.
Switch Oracle schema definition to make the serialized event column non null. Adapt test cases to always contain some content for the serialized event. Original pull request: GH-868.
This commit is contained in:
@@ -400,7 +400,7 @@ class JdbcEventPublicationRepository implements EventPublicationRepository, Bean
|
||||
var completionDate = rs.getTimestamp("COMPLETION_DATE");
|
||||
var publicationDate = rs.getTimestamp("PUBLICATION_DATE").toInstant();
|
||||
var listenerId = rs.getString("LISTENER_ID");
|
||||
var serializedEvent = Optional.ofNullable(rs.getString("SERIALIZED_EVENT")).orElse("");
|
||||
var serializedEvent = rs.getString("SERIALIZED_EVENT");
|
||||
|
||||
return new JdbcEventPublication(id, publicationDate, listenerId,
|
||||
() -> serializer.deserialize(serializedEvent, eventClass),
|
||||
|
||||
@@ -3,7 +3,7 @@ CREATE TABLE IF NOT EXISTS EVENT_PUBLICATION (
|
||||
ID VARCHAR2(36) NOT NULL,
|
||||
LISTENER_ID VARCHAR2(512) NOT NULL,
|
||||
EVENT_TYPE VARCHAR2(512) NOT NULL,
|
||||
SERIALIZED_EVENT VARCHAR2(4000),
|
||||
SERIALIZED_EVENT VARCHAR2(4000) NOT NULL,
|
||||
PUBLICATION_DATE TIMESTAMP(6) NOT NULL,
|
||||
COMPLETION_DATE TIMESTAMP(6),
|
||||
CONSTRAINT EVENT_PUBLICATION_PK PRIMARY KEY(ID)
|
||||
|
||||
@@ -353,10 +353,10 @@ class JdbcEventPublicationRepositoryIntegrationTests {
|
||||
var event = new Sample();
|
||||
|
||||
// Serialize to whatever
|
||||
doReturn("").when(serializer).serialize(event);
|
||||
doReturn("sample").when(serializer).serialize(event);
|
||||
|
||||
// Return fresh instances for every deserialization attempt
|
||||
doAnswer(__ -> new Sample()).when(serializer).deserialize("", Sample.class);
|
||||
doAnswer(__ -> new Sample()).when(serializer).deserialize("sample", Sample.class);
|
||||
|
||||
repository.create(TargetEventPublication.of(event, TARGET_IDENTIFIER));
|
||||
|
||||
@@ -476,7 +476,7 @@ class JdbcEventPublicationRepositoryIntegrationTests {
|
||||
|
||||
@WithMariaDB
|
||||
class MariaDBWithDeleteCompletion extends WithDeleteCompletion {}
|
||||
|
||||
|
||||
// Oracle
|
||||
|
||||
@WithOracle
|
||||
@@ -523,7 +523,7 @@ class JdbcEventPublicationRepositoryIntegrationTests {
|
||||
@ActiveProfiles("mssql")
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@interface WithMssql {}
|
||||
|
||||
|
||||
@Nested
|
||||
@ActiveProfiles("oracle")
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
|
||||
Reference in New Issue
Block a user