Skip to content
Snippets Groups Projects
Commit 28a05fb3 authored by Martin's avatar Martin
Browse files

OZG-7872 add safety tests

parent b84b32e0
Branches
Tags
1 merge request!26OZG-7872 OZG-8039 add related resource link on postfach
This commit is part of merge request !26. Comments created here will be created in the context of that merge request.
...@@ -45,6 +45,16 @@ class CommandProcessorTest { ...@@ -45,6 +45,16 @@ class CommandProcessorTest {
verify(processor).isResponsibleForEffectedResource(CommandOrder.fromOrder(CommandTestFactory.ORDER)); verify(processor).isResponsibleForEffectedResource(CommandOrder.fromOrder(CommandTestFactory.ORDER));
} }
@DisplayName("should NOT create link builder for related resource if the responsibility matches")
@Test
void shouldNOTCallCreateEffectedResourceLinkBuilder() {
when(processor.isResponsibleForEffectedResource(any())).thenReturn(false);
processor.process(model);
verify(processor, never()).createEffectedResourceLinkBuilder(command);
}
@DisplayName("should create link builder for effected resource if the responsibility matches") @DisplayName("should create link builder for effected resource if the responsibility matches")
@Test @Test
void shouldCallCreateEffectedResourceLinkBuilder() { void shouldCallCreateEffectedResourceLinkBuilder() {
...@@ -107,6 +117,16 @@ class CommandProcessorTest { ...@@ -107,6 +117,16 @@ class CommandProcessorTest {
verify(processor).createRelatedResourceLinkBuilder(command); verify(processor).createRelatedResourceLinkBuilder(command);
} }
@DisplayName("should NOT create link builder for related resource if the responsibility matches")
@Test
void shouldNOTCallCreateRelatedResourceLinkBuilder() {
when(processor.isResponsibleForRelatedResource(any())).thenReturn(false);
processor.process(model);
verify(processor, never()).createRelatedResourceLinkBuilder(command);
}
@DisplayName("link") @DisplayName("link")
@Nested @Nested
class TestRelatedResourceLink { class TestRelatedResourceLink {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment