|
|
@@ -1089,7 +1089,7 @@ class MapLogRepositoryTest {
|
|
|
@Test
|
|
|
@DisplayName("DB Test: findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging#1")
|
|
|
void findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging_NM1(Vertx vertx, VertxTestContext testContext) {
|
|
|
- repo.findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging(USER_IDENTITY, 2, 2000, null, null, 0, 4, emptyList()).onComplete(testContext.succeeding(data -> testContext.verify(() -> {
|
|
|
+ repo.findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging(USER_IDENTITY, 2, 2000, null, null, 0, 4, SortType.ASC, emptyList()).onComplete(testContext.succeeding(data -> testContext.verify(() -> {
|
|
|
assertThat(data.size()).isEqualTo(4);
|
|
|
assertThat(data.hasNext()).isTrue();
|
|
|
|
|
|
@@ -1128,7 +1128,7 @@ class MapLogRepositoryTest {
|
|
|
|
|
|
OffsetDateTime from = OffsetDateTime.of(2023, 12, 20, 0, 0, 0, 0, UTC);
|
|
|
|
|
|
- repo.findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging(USER_IDENTITY,2, 2000, from, null, 0, 5, emptyList()).onComplete(testContext.succeeding(data -> testContext.verify(() -> {
|
|
|
+ repo.findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging(USER_IDENTITY,2, 2000, from, null, 0, 5, SortType.ASC, emptyList()).onComplete(testContext.succeeding(data -> testContext.verify(() -> {
|
|
|
assertThat(data.size()).isEqualTo(5);
|
|
|
assertThat(data.hasNext()).isTrue();
|
|
|
|
|
|
@@ -1151,7 +1151,7 @@ class MapLogRepositoryTest {
|
|
|
OffsetDateTime from = OffsetDateTime.of(2023, 12, 20, 0, 0, 0, 0, UTC);
|
|
|
OffsetDateTime to = OffsetDateTime.of(2023, 12, 25, 0, 0, 0, 0, UTC);
|
|
|
|
|
|
- repo.findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging(USER_IDENTITY,2, 2000, from, to, 0, 10, emptyList()).onComplete(testContext.succeeding(data -> testContext.verify(() -> {
|
|
|
+ repo.findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging(USER_IDENTITY,2, 2000, from, to, 0, 10, SortType.ASC, emptyList()).onComplete(testContext.succeeding(data -> testContext.verify(() -> {
|
|
|
assertThat(data.size()).isEqualTo(3);
|
|
|
assertThat(data.hasNext()).isFalse();
|
|
|
|
|
|
@@ -1174,7 +1174,7 @@ class MapLogRepositoryTest {
|
|
|
OffsetDateTime from = OffsetDateTime.of(2023, 12, 25, 0, 0, 0, 0, UTC);
|
|
|
OffsetDateTime to = OffsetDateTime.of(2024, 1, 1, 0, 0, 0, 0, UTC);
|
|
|
|
|
|
- repo.findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging(USER_IDENTITY,2, 2000, from, to, 0, 10, emptyList()).onComplete(testContext.succeeding(data -> testContext.verify(() -> {
|
|
|
+ repo.findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging(USER_IDENTITY,2, 2000, from, to, 0, 10, SortType.ASC, emptyList()).onComplete(testContext.succeeding(data -> testContext.verify(() -> {
|
|
|
assertThat(data.size()).isEqualTo(2);
|
|
|
assertThat(data.hasNext()).isFalse();
|
|
|
|
|
|
@@ -1196,7 +1196,7 @@ class MapLogRepositoryTest {
|
|
|
|
|
|
OffsetDateTime to = OffsetDateTime.of(2023, 12, 25, 0, 0, 0, 0, UTC);
|
|
|
|
|
|
- repo.findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging(USER_IDENTITY,2, 2000, null, to, 0, 10, emptyList()).onComplete(testContext.succeeding(data -> testContext.verify(() -> {
|
|
|
+ repo.findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging(USER_IDENTITY,2, 2000, null, to, 0, 10, SortType.ASC, emptyList()).onComplete(testContext.succeeding(data -> testContext.verify(() -> {
|
|
|
assertThat(data.size()).isEqualTo(3);
|
|
|
assertThat(data.hasNext()).isFalse();
|
|
|
|
|
|
@@ -1215,7 +1215,7 @@ class MapLogRepositoryTest {
|
|
|
@Test
|
|
|
@DisplayName("DB Test: findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging#6")
|
|
|
void findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging_NM6(Vertx vertx, VertxTestContext testContext) {
|
|
|
- repo.findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging(USER_IDENTITY,2, 2000, null, null, 4, 1, emptyList()).onComplete(testContext.succeeding(data -> testContext.verify(() -> {
|
|
|
+ repo.findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging(USER_IDENTITY,2, 2000, null, null, 4, 1, SortType.ASC, emptyList()).onComplete(testContext.succeeding(data -> testContext.verify(() -> {
|
|
|
assertThat(data.size()).isEqualTo(1);
|
|
|
assertThat(data.hasNext()).isTrue();
|
|
|
|
|
|
@@ -1235,7 +1235,7 @@ class MapLogRepositoryTest {
|
|
|
Filter.of(FilterType.UNIT, FilterAttribute.SPEED, null, FilterOperation.NE, 0f)
|
|
|
);
|
|
|
|
|
|
- repo.findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging(USER_IDENTITY,2, 2000, null, null, 0, 1, filters).onComplete(testContext.succeeding(data -> testContext.verify(() -> {
|
|
|
+ repo.findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging(USER_IDENTITY,2, 2000, null, null, 0, 1, SortType.ASC, filters).onComplete(testContext.succeeding(data -> testContext.verify(() -> {
|
|
|
assertThat(data.size()).isEqualTo(1);
|
|
|
assertThat(data.hasNext()).isTrue();
|
|
|
|
|
|
@@ -1258,7 +1258,7 @@ class MapLogRepositoryTest {
|
|
|
Filter.of(FilterType.UNIT, FilterAttribute.LATITUDE, null, FilterOperation.LT, 45.f)
|
|
|
);
|
|
|
|
|
|
- repo.findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging(USER_IDENTITY,2, 2000, null, null, 0, 1, filters).onComplete(testContext.succeeding(data -> testContext.verify(() -> {
|
|
|
+ repo.findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging(USER_IDENTITY,2, 2000, null, null, 0, 1, SortType.ASC, filters).onComplete(testContext.succeeding(data -> testContext.verify(() -> {
|
|
|
assertThat(data.size()).isEqualTo(1);
|
|
|
|
|
|
UnitTelemetry t = data.data().get(0);
|
|
|
@@ -1276,7 +1276,7 @@ class MapLogRepositoryTest {
|
|
|
// No observations before the date 'to'.
|
|
|
OffsetDateTime to = OffsetDateTime.of(2023, 12, 20, 0, 0, 0, 0, UTC);
|
|
|
|
|
|
- repo.findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging(USER_IDENTITY,2, 2000, null, to, 0, 1, emptyList()).onComplete(testContext.succeeding(data -> testContext.verify(() -> {
|
|
|
+ repo.findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging(USER_IDENTITY,2, 2000, null, to, 0, 1, SortType.ASC, emptyList()).onComplete(testContext.succeeding(data -> testContext.verify(() -> {
|
|
|
assertThat(data.size()).isEqualTo(0);
|
|
|
assertThat(data.hasNext()).isFalse();
|
|
|
|
|
|
@@ -1291,7 +1291,7 @@ class MapLogRepositoryTest {
|
|
|
|
|
|
OffsetDateTime from = OffsetDateTime.of(2024, 2, 1, 0, 0, 0, 0, UTC);
|
|
|
|
|
|
- repo.findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging(USER_IDENTITY,2, 2000, from, null, 0, 1, emptyList()).onComplete(testContext.succeeding(data -> testContext.verify(() -> {
|
|
|
+ repo.findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging(USER_IDENTITY,2, 2000, from, null, 0, 1, SortType.ASC, emptyList()).onComplete(testContext.succeeding(data -> testContext.verify(() -> {
|
|
|
assertThat(data.size()).isEqualTo(1);
|
|
|
assertThat(data.hasNext()).isFalse();
|
|
|
|
|
|
@@ -1307,7 +1307,7 @@ class MapLogRepositoryTest {
|
|
|
@DisplayName("DB Test: findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging#11")
|
|
|
void findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging_NM11(Vertx vertx, VertxTestContext testContext) {
|
|
|
// Campaign ID 10 does not exist.
|
|
|
- repo.findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging(USER_IDENTITY,10, 2000, null, null, 0, 1, emptyList()).onComplete(testContext.succeeding(data -> testContext.verify(() -> {
|
|
|
+ repo.findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging(USER_IDENTITY,10, 2000, null, null, 0, 1, SortType.ASC, emptyList()).onComplete(testContext.succeeding(data -> testContext.verify(() -> {
|
|
|
assertThat(data.size()).isEqualTo(0);
|
|
|
assertThat(data.hasNext()).isFalse();
|
|
|
|
|
|
@@ -1319,7 +1319,7 @@ class MapLogRepositoryTest {
|
|
|
@DisplayName("DB Test: findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging#12")
|
|
|
void findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging_NM12(Vertx vertx, VertxTestContext testContext) {
|
|
|
// No access to the unit 1000 from the campaign 2
|
|
|
- repo.findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging(USER_IDENTITY,2, 1000, null, null, 0, 1, emptyList()).onComplete(testContext.succeeding(data -> testContext.verify(() -> {
|
|
|
+ repo.findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging(USER_IDENTITY,2, 1000, null, null, 0, 1, SortType.ASC, emptyList()).onComplete(testContext.succeeding(data -> testContext.verify(() -> {
|
|
|
assertThat(data.size()).isEqualTo(0);
|
|
|
assertThat(data.hasNext()).isFalse();
|
|
|
|
|
|
@@ -1331,7 +1331,7 @@ class MapLogRepositoryTest {
|
|
|
@DisplayName("DB Test: findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging#13")
|
|
|
void findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging_NM13(Vertx vertx, VertxTestContext testContext) {
|
|
|
// No user's access to the campaign 1
|
|
|
- repo.findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging(USER_IDENTITY,1, 3000, null, null, 0, 1, emptyList()).onComplete(testContext.succeeding(data -> testContext.verify(() -> {
|
|
|
+ repo.findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging(USER_IDENTITY,1, 3000, null, null, 0, 1, SortType.ASC, emptyList()).onComplete(testContext.succeeding(data -> testContext.verify(() -> {
|
|
|
assertThat(data.size()).isEqualTo(0);
|
|
|
assertThat(data.hasNext()).isFalse();
|
|
|
|
|
|
@@ -1348,7 +1348,7 @@ class MapLogRepositoryTest {
|
|
|
Filter.of(FilterType.SENSOR, FilterAttribute.ID, "2002", FilterOperation.EQ, 22)
|
|
|
);
|
|
|
|
|
|
- repo.findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging(USER_IDENTITY, 2, 2000, null, null, 0, 10, filters).onComplete(testContext.succeeding(data -> testContext.verify(() -> {
|
|
|
+ repo.findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging(USER_IDENTITY, 2, 2000, null, null, 0, 10, SortType.ASC, filters).onComplete(testContext.succeeding(data -> testContext.verify(() -> {
|
|
|
assertThat(data.size()).isEqualTo(1);
|
|
|
|
|
|
UnitTelemetry t = data.data().get(0);
|