From f38ceda044add8a01bc9cc1a198590fda49e94e2 Mon Sep 17 00:00:00 2001 From: nitram509 Date: Fri, 27 Aug 2021 23:32:48 +0200 Subject: [PATCH] rework from JUnit4.x to JUnit5.x add partitionId and position as recommended, https://github.com/camunda-community-hub/zeebe-simple-monitor/pull/285#pullrequestreview-740435360 --- .../monitor/repository/ElementInstanceRepositoryTest.java | 2 +- .../io/zeebe/monitor/repository/VariableRepositoryTest.java | 2 +- .../io/zeebe/monitor/repository/ZeebeRepositoryTest.java | 5 ++--- .../zeebe/importers/ProcessAndElementImporterTest.java | 4 +++- .../zeebe/monitor/zeebe/importers/VariableImporterTest.java | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/test/java/io/zeebe/monitor/repository/ElementInstanceRepositoryTest.java b/src/test/java/io/zeebe/monitor/repository/ElementInstanceRepositoryTest.java index 46771241..f24e30e9 100644 --- a/src/test/java/io/zeebe/monitor/repository/ElementInstanceRepositoryTest.java +++ b/src/test/java/io/zeebe/monitor/repository/ElementInstanceRepositoryTest.java @@ -1,7 +1,7 @@ package io.zeebe.monitor.repository; import io.zeebe.monitor.entity.ElementInstanceEntity; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; diff --git a/src/test/java/io/zeebe/monitor/repository/VariableRepositoryTest.java b/src/test/java/io/zeebe/monitor/repository/VariableRepositoryTest.java index a4c75daa..c6999ef8 100644 --- a/src/test/java/io/zeebe/monitor/repository/VariableRepositoryTest.java +++ b/src/test/java/io/zeebe/monitor/repository/VariableRepositoryTest.java @@ -1,7 +1,7 @@ package io.zeebe.monitor.repository; import io.zeebe.monitor.entity.VariableEntity; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; diff --git a/src/test/java/io/zeebe/monitor/repository/ZeebeRepositoryTest.java b/src/test/java/io/zeebe/monitor/repository/ZeebeRepositoryTest.java index 99ff272c..e7538c16 100644 --- a/src/test/java/io/zeebe/monitor/repository/ZeebeRepositoryTest.java +++ b/src/test/java/io/zeebe/monitor/repository/ZeebeRepositoryTest.java @@ -1,13 +1,12 @@ package io.zeebe.monitor.repository; -import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; import org.springframework.transaction.annotation.Transactional; -@RunWith(SpringJUnit4ClassRunner.class) +@SpringBootTest @ContextConfiguration( classes = {TestContextJpaConfiguration.class}, loader = AnnotationConfigContextLoader.class) diff --git a/src/test/java/io/zeebe/monitor/zeebe/importers/ProcessAndElementImporterTest.java b/src/test/java/io/zeebe/monitor/zeebe/importers/ProcessAndElementImporterTest.java index 54cd2bdc..43bf111c 100644 --- a/src/test/java/io/zeebe/monitor/zeebe/importers/ProcessAndElementImporterTest.java +++ b/src/test/java/io/zeebe/monitor/zeebe/importers/ProcessAndElementImporterTest.java @@ -6,7 +6,7 @@ import io.zeebe.monitor.repository.ElementInstanceRepository; import io.zeebe.monitor.repository.ZeebeRepositoryTest; import io.zeebe.monitor.zeebe.ZeebeNotificationService; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.messaging.simp.SimpMessagingTemplate; @@ -49,6 +49,8 @@ private Schema.ProcessInstanceRecord createElementInstanceWithId(String elementI return Schema.ProcessInstanceRecord.newBuilder() .setElementId(elementId) .setMetadata(Schema.RecordMetadata.newBuilder() + .setPosition(333L) + .setPartitionId(55555) .setIntent(ProcessInstanceIntent.ELEMENT_ACTIVATED.name())) .build(); } diff --git a/src/test/java/io/zeebe/monitor/zeebe/importers/VariableImporterTest.java b/src/test/java/io/zeebe/monitor/zeebe/importers/VariableImporterTest.java index 360ed72f..91e71780 100644 --- a/src/test/java/io/zeebe/monitor/zeebe/importers/VariableImporterTest.java +++ b/src/test/java/io/zeebe/monitor/zeebe/importers/VariableImporterTest.java @@ -4,7 +4,7 @@ import io.zeebe.monitor.entity.VariableEntity; import io.zeebe.monitor.repository.VariableRepository; import io.zeebe.monitor.repository.ZeebeRepositoryTest; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration;