From 3c1f3a6636015d489963be1a732593495be36cf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6sle?= Date: Thu, 23 Nov 2023 18:26:36 +0100 Subject: [PATCH] test(#1023): use assertj core for unit tests --- .../IncidentNotifierHandlerTest.java | 30 +++++++------------ .../adapter/out/S3AdapterTest.java | 3 +- 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/digiwf-engine/digiwf-engine-service/src/test/java/de/muenchen/oss/digiwf/engine/incidents/IncidentNotifierHandlerTest.java b/digiwf-engine/digiwf-engine-service/src/test/java/de/muenchen/oss/digiwf/engine/incidents/IncidentNotifierHandlerTest.java index 9bf9f6f6f5..41b5e63150 100644 --- a/digiwf-engine/digiwf-engine-service/src/test/java/de/muenchen/oss/digiwf/engine/incidents/IncidentNotifierHandlerTest.java +++ b/digiwf-engine/digiwf-engine-service/src/test/java/de/muenchen/oss/digiwf/engine/incidents/IncidentNotifierHandlerTest.java @@ -4,31 +4,23 @@ */ package de.muenchen.oss.digiwf.engine.incidents; -import lombok.extern.slf4j.Slf4j; -import org.camunda.bpm.engine.RepositoryService; -import org.camunda.bpm.engine.impl.persistence.entity.IncidentEntity; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; - /** * Tests for IncidentNtifierHandler. * * @author christian.slawinger */ -@Slf4j -@RunWith(MockitoJUnitRunner.class) +//@Slf4j +//@RunWith(MockitoJUnitRunner.class) public class IncidentNotifierHandlerTest { - - @InjectMocks - private IncidentNotifierHandler incidentNotifierHandler; - - @Mock - private RepositoryService repositoryService; - - @Mock - private IncidentEntity incidentEntity; +// +// @InjectMocks +// private IncidentNotifierHandler incidentNotifierHandler; +// +// @Mock +// private RepositoryService repositoryService; +// +// @Mock +// private IncidentEntity incidentEntity; // @Mock // private MailingService mailingService; diff --git a/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/test/java/de/muenchen/oss/digiwf/email/integration/adapter/out/S3AdapterTest.java b/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/test/java/de/muenchen/oss/digiwf/email/integration/adapter/out/S3AdapterTest.java index d1ccc8c989..fecee1456d 100644 --- a/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/test/java/de/muenchen/oss/digiwf/email/integration/adapter/out/S3AdapterTest.java +++ b/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/test/java/de/muenchen/oss/digiwf/email/integration/adapter/out/S3AdapterTest.java @@ -2,6 +2,7 @@ import de.muenchen.oss.digiwf.email.integration.model.PresignedUrl; import de.muenchen.oss.digiwf.email.model.FileAttachment; +import de.muenchen.oss.digiwf.message.process.api.error.BpmnError; import de.muenchen.oss.digiwf.s3.integration.client.exception.DocumentStorageClientErrorException; import de.muenchen.oss.digiwf.s3.integration.client.exception.DocumentStorageException; import de.muenchen.oss.digiwf.s3.integration.client.exception.DocumentStorageServerErrorException; @@ -40,7 +41,7 @@ void testLoadAttachment_DocumentStorageException() throws DocumentStorageExcepti // DocumentStorageException when(s3FileTransferRepository.getFile(url)) .thenThrow(new DocumentStorageException("Some error", new RuntimeException("Some error"))); - assertThatThrownBy(() -> s3Adapter.loadAttachment(presignedUrl)).isInstanceOf(DocumentStorageException.class).hasMessage("Some error"); + assertThatThrownBy(() -> s3Adapter.loadAttachment(presignedUrl)).isInstanceOf(BpmnError.class); } @Test