Skip to content

Commit

Permalink
test(#1023): use assertj core for unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lmoesle committed Nov 29, 2023
1 parent 2c4998e commit 3c1f3a6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3c1f3a6

Please sign in to comment.