Skip to content
This repository was archived by the owner on Aug 13, 2020. It is now read-only.

Commit faf159d

Browse files
authored
Merge pull request #410 from CJSCommonPlatform/framework-api-tweaks
Framework API tweaks
2 parents 88fe399 + 497fc0a commit faf159d

File tree

38 files changed

+74
-119
lines changed

38 files changed

+74
-119
lines changed

aggregate-snapshot/aggregate-snapshot-domain/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</dependency>
1919
<dependency>
2020
<groupId>uk.gov.justice.services</groupId>
21-
<artifactId>framework-api-aggregate</artifactId>
21+
<artifactId>framework-api-aggregate-service</artifactId>
2222
<version>${project.version}</version>
2323
</dependency>
2424
<dependency>
@@ -37,4 +37,4 @@
3737
<scope>test</scope>
3838
</dependency>
3939
</dependencies>
40-
</project>
40+
</project>

aggregate-snapshot/aggregate-snapshot-service/src/test/java/uk/gov/justice/domain/aggregate/TestAggregate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ public Object apply(Object event) {
5555
recordedEventStates.add(event);
5656
}));
5757
}
58-
}
58+
}

aggregate/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</dependency>
2020
<dependency>
2121
<groupId>uk.gov.justice.services</groupId>
22-
<artifactId>framework-api-aggregate</artifactId>
22+
<artifactId>framework-api-aggregate-service</artifactId>
2323
<version>${project.version}</version>
2424
</dependency>
2525
<dependency>

aggregate/src/test/java/uk/gov/justice/domain/aggregate/TestAggregate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ public Object apply(Object event) {
5050
recordedEventStates.add(event);
5151
}));
5252
}
53-
}
53+
}

aggregate/src/test/java/uk/gov/justice/services/core/aggregate/DefaultAggregateServiceTest.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import uk.gov.justice.services.common.converter.JsonObjectToObjectConverter;
1818
import uk.gov.justice.services.core.aggregate.event.EventA;
1919
import uk.gov.justice.services.core.aggregate.event.EventB;
20-
import uk.gov.justice.services.core.aggregate.exception.AggregateChangeDetectedException;
2120
import uk.gov.justice.services.core.extension.EventFoundEvent;
2221
import uk.gov.justice.services.eventsourcing.source.core.EventStream;
2322

@@ -58,7 +57,7 @@ private void registerEvent(Class clazz, String name) {
5857
}
5958

6059
@Test
61-
public void shouldCreateAggregateFromEmptyStream() throws AggregateChangeDetectedException {
60+
public void shouldCreateAggregateFromEmptyStream() {
6261
when(eventStream.read()).thenReturn(Stream.empty());
6362
when(eventStream.getId()).thenReturn(STREAM_ID);
6463
TestAggregate aggregate = aggregateService.get(eventStream, TestAggregate.class);
@@ -69,7 +68,7 @@ public void shouldCreateAggregateFromEmptyStream() throws AggregateChangeDetecte
6968
}
7069

7170
@Test
72-
public void shouldCreateAggregateFromSingletonStream() throws AggregateChangeDetectedException {
71+
public void shouldCreateAggregateFromSingletonStream() {
7372
JsonObject eventPayloadA = mock(JsonObject.class);
7473
EventA eventA = mock(EventA.class);
7574
when(jsonObjectToObjectConverter.convert(eventPayloadA, EventA.class)).thenReturn(eventA);
@@ -88,7 +87,7 @@ public void shouldCreateAggregateFromSingletonStream() throws AggregateChangeDet
8887
}
8988

9089
@Test
91-
public void shouldCreateAggregateFromStreamOfTwo() throws AggregateChangeDetectedException {
90+
public void shouldCreateAggregateFromStreamOfTwo() {
9291
JsonObject eventPayloadA = mock(JsonObject.class);
9392
JsonObject eventPayloadB = mock(JsonObject.class);
9493
EventA eventA = mock(EventA.class);
@@ -116,7 +115,7 @@ public void shouldCreateAggregateFromStreamOfTwo() throws AggregateChangeDetecte
116115
}
117116

118117
@Test(expected = IllegalStateException.class)
119-
public void shouldThrowExceptionForUnregisteredEvent() throws AggregateChangeDetectedException {
118+
public void shouldThrowExceptionForUnregisteredEvent() {
120119
when(eventStream.getId()).thenReturn(STREAM_ID);
121120

122121
JsonObject eventPayloadA = mock(JsonObject.class);
@@ -128,7 +127,7 @@ public void shouldThrowExceptionForUnregisteredEvent() throws AggregateChangeDet
128127
}
129128

130129
@Test(expected = RuntimeException.class)
131-
public void shouldThrowExceptionForNonInstantiatableEvent() throws AggregateChangeDetectedException {
130+
public void shouldThrowExceptionForNonInstantiatableEvent() {
132131
JsonObject eventPayloadA = mock(JsonObject.class);
133132
EventA eventA = mock(EventA.class);
134133
when(jsonObjectToObjectConverter.convert(eventPayloadA, EventA.class)).thenReturn(eventA);

domain/pom.xml

Lines changed: 0 additions & 31 deletions
This file was deleted.

framework-api/framework-api-aggregate/pom.xml renamed to framework-api/framework-api-aggregate-service/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

12-
<artifactId>framework-api-aggregate</artifactId>
12+
<artifactId>framework-api-aggregate-service</artifactId>
1313

1414
<dependencies>
1515
<dependency>
@@ -35,4 +35,4 @@
3535
<scope>test</scope>
3636
</dependency>
3737
</dependencies>
38-
</project>
38+
</project>

0 commit comments

Comments
 (0)