-
Notifications
You must be signed in to change notification settings - Fork 3
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
add stream transformation support for linked events #25
add stream transformation support for linked events #25
Conversation
|
||
logger.info("-------------- Truncating the Linked Events Log after complete transformation --------------"); | ||
|
||
linkedEventStreamTransformationService.truncateLinkedEvents(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you need to call truncateLinkedEvents() twice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
@@ -158,19 +168,28 @@ public void shouldRemoveFinishedTaskForAllPasses() { | |||
|
|||
startTransformation.taskDone(future3, null, null, null); | |||
assertThat(startTransformation.outstandingTasks.size(), is(0)); | |||
|
|||
// verify(linkedEventStreamTransformationService).truncateLinkedEvents(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please uncomment/delete verify (although we should verify that truncateLinkedEvents() and populateLinkedEvents() are called )
pom.xml
Outdated
@@ -23,8 +23,9 @@ | |||
<properties> | |||
<cpp.repo.name>stream-transformation-tool</cpp.repo.name> | |||
|
|||
<framework.version>5.0.4</framework.version> | |||
<event-store.version>1.0.4</event-store.version> | |||
<framework.version>5.1.2-SNAPSHOT</framework.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use snapshots please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
waiting for the release version of frame work api
private final LiquibaseUtil liquibaseUtil = new LiquibaseUtil(); | ||
|
||
DataSource dataSource = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why dataSource was moved outside of DatabaseUtils() constructor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
datasource required for other test classes in the same package
@@ -15,7 +16,6 @@ | |||
private EventLogBuilder() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it EventLogBuilder or just EventBuilder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EventLogBuilder
|
||
import javax.sql.DataSource; | ||
|
||
public class TestLinkedEventJdbcRepository extends LinkedEventJdbcRepository { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is a test helper class, but maybe it's worth considering moving this logic to framework or test-utils so can be used by other people as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
} | ||
|
||
@After | ||
public void cleanup() throws Exception { | ||
databaseUtils.resetDatabase(); | ||
// databaseUtils.resetDatabase(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove cleanup() please
import org.mockito.runners.MockitoJUnitRunner; | ||
|
||
@RunWith(MockitoJUnitRunner.class) | ||
public class LinkedEventStreamTransformationServiceTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem to test anything.
@@ -95,6 +99,9 @@ public void shouldCreateTasksForEachStream() { | |||
|
|||
assertThat(startTransformation.outstandingTasks.size(), is(2)); | |||
assertTrue(startTransformation.allTasksCreated); | |||
|
|||
// verify(linkedEventStreamTransformationService).truncateLinkedEvents(); | |||
// verify(linkedEventStreamTransformationService).populateLinkedEvents(); | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented out code can be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
@@ -119,6 +126,9 @@ public void shouldRemoveFinishedTasks() { | |||
|
|||
startTransformation.taskDone(future2, null, null, null); | |||
assertThat(startTransformation.outstandingTasks.size(), is(0)); | |||
|
|||
// verify(linkedEventStreamTransformationService).truncateLinkedEvents(); | |||
// verify(linkedEventStreamTransformationService).populateLinkedEvents(); | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented out code can be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
private final LiquibaseUtil liquibaseUtil = new LiquibaseUtil(); | ||
|
||
DataSource dataSource = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be private (and final if possible)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private not final used outside constructor
@@ -19,11 +20,11 @@ | |||
|
|||
private TestEventLogJdbcRepository eventLogJdbcRepository; | |||
private TestEventStreamJdbcRepository eventStreamJdbcRepository; | |||
|
|||
private EventFetcherRepository eventFetcherRepository = new EventFetcherRepository(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
CHANGELOG.md
Outdated
@@ -5,6 +5,9 @@ on [Keep a CHANGELOG](http://keepachangelog.com/). This project adheres to | |||
|
|||
## [Unreleased] | |||
|
|||
## [5.2.0] - 2018-12-12 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like the wrong date
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
} | ||
|
||
|
||
@Test(expected = IllegalArgumentException.class) | ||
public void shouldThrowExceptionWhenstreamsProcessedCountStepInfoIsNull() throws Exception { | ||
streamsProcessedCountStepInfo.set(startTransformation, null); | ||
startTransformation.go(); | ||
// | ||
// verify(linkedEventStreamTransformationService).truncateLinkedEvents(); | ||
// verify(linkedEventStreamTransformationService).populateLinkedEvents(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this comment code should be reinstated or deleted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done as mentioned by allan and martin
<groupId>uk.gov.justice.framework-api</groupId> | ||
<artifactId>framework-api-core</artifactId> | ||
<version>${framework-api.version}</version> | ||
</dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is not a test dependency then it should be higher in the list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
<groupId>uk.gov.justice.event-store</groupId> | ||
<artifactId>event-repository-jdbc</artifactId> | ||
<version>${event-store.version}</version> | ||
</dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non test dependencies above should be moved above the test dependency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -20,24 +21,25 @@ | |||
public class StreamTransformationMoveIT { | |||
|
|||
private static final UUID STREAM_ID = randomUUID(); | |||
private static final long STREAM_COUNT_REPORTING_INTERVAL = 10l; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uppercase L is easier to read - 10L
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -75,7 +75,7 @@ public UUID transformEventStream(final UUID originalStreamId, final int pass) { | |||
|
|||
if (action.isTransform()) { | |||
final Optional<UUID> newStreamId = eventTransformationStreamIdFilter.getEventTransformationStreamId(eventTransformations, jsonEnvelopeList); | |||
if (newStreamId.isPresent()) { | |||
if (newStreamId.isPresent() && !newStreamId.get().equals(originalStreamId)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this check be created as a method or value and have a descriptive name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DONE
pom.xml
Outdated
|
||
<framework.version>5.0.4</framework.version> | ||
<event-store.version>1.0.4</event-store.version> | ||
<framework-api.version>4.0.0-M2</framework-api.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
framework-api version is 3.1.1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
pom.xml
Outdated
<framework.version>5.0.4</framework.version> | ||
<event-store.version>1.0.4</event-store.version> | ||
<framework-api.version>4.0.0-M2</framework-api.version> | ||
<framework.version>6.0.0-M4</framework.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
framework version is 5.1.2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
CHANGELOG.md
Outdated
@@ -5,6 +5,9 @@ on [Keep a CHANGELOG](http://keepachangelog.com/). This project adheres to | |||
|
|||
## [Unreleased] | |||
|
|||
## [5.2.0] - 2019-03-18 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong date now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
8221936
to
a3a6b07
Compare
a3a6b07
to
2a128b5
Compare
2a128b5
to
0cd9e44
Compare
No description provided.