Skip to content
Snippets Groups Projects
Commit 59b1496a authored by OZGCloud's avatar OZGCloud
Browse files

OZG-3371 improve test

parent ef2fd3b3
No related branches found
No related tags found
No related merge requests found
...@@ -256,47 +256,52 @@ public class OsiPostfachRemoteServiceTest { ...@@ -256,47 +256,52 @@ public class OsiPostfachRemoteServiceTest {
@Test @Test
void shouldHaveVorgangIdAsSequenceNumber() { void shouldHaveVorgangIdAsSequenceNumber() {
when(mapper.toOsiMessage(any())).thenReturn(MessageTestFactory.create()); val postfachNachricht = PostfachNachrichtTestFactory.create();
when(mapper.toOsiMessage(postfachNachricht)).thenReturn(MessageTestFactory.create());
prepareMockServer().andExpect(jsonPath("$.sequenceNumber").value(VORGANG_ID)); prepareMockServer().andExpect(jsonPath("$.sequenceNumber").value(VORGANG_ID));
service.sendMessage(PostfachNachrichtTestFactory.create()); service.sendMessage(postfachNachricht);
} }
@Test @Test
void shouldHavePostfachIdAsNameIdentifier() { void shouldHavePostfachIdAsNameIdentifier() {
when(mapper.toOsiMessage(any())).thenReturn(MessageTestFactory.create()); val postfachNachricht = PostfachNachrichtTestFactory.create();
when(mapper.toOsiMessage(postfachNachricht)).thenReturn(MessageTestFactory.create());
prepareMockServer().andExpect(jsonPath("$.nameIdentifier").value(POSTFACH_ID)); prepareMockServer().andExpect(jsonPath("$.nameIdentifier").value(POSTFACH_ID));
service.sendMessage(PostfachNachrichtTestFactory.create()); service.sendMessage(postfachNachricht);
} }
@Test @Test
void shouldHaveSubject() { void shouldHaveSubject() {
when(mapper.toOsiMessage(any())).thenReturn(MessageTestFactory.create()); val postfachNachricht = PostfachNachrichtTestFactory.create();
when(mapper.toOsiMessage(postfachNachricht)).thenReturn(MessageTestFactory.create());
prepareMockServer().andExpect(jsonPath("$.subject").value(SUBJECT)); prepareMockServer().andExpect(jsonPath("$.subject").value(SUBJECT));
service.sendMessage(PostfachNachrichtTestFactory.create()); service.sendMessage(postfachNachricht);
} }
@Test @Test
void shouldHaveMailBodyAsBody() { void shouldHaveMailBodyAsBody() {
when(mapper.toOsiMessage(any())).thenReturn(MessageTestFactory.create()); val postfachNachricht = PostfachNachrichtTestFactory.create();
when(mapper.toOsiMessage(postfachNachricht)).thenReturn(MessageTestFactory.create());
prepareMockServer().andExpect(jsonPath("$.body").value(MAIL_BODY)); prepareMockServer().andExpect(jsonPath("$.body").value(MAIL_BODY));
service.sendMessage(PostfachNachrichtTestFactory.create()); service.sendMessage(postfachNachricht);
} }
@Test @Test
void shouldHaveNumericReplyOptionAsReplyAction() { void shouldHaveNumericReplyOptionAsReplyAction() {
when(mapper.toOsiMessage(any())).thenReturn(MessageTestFactory.create()); val postfachNachricht = PostfachNachrichtTestFactory.create();
when(mapper.toOsiMessage(postfachNachricht)).thenReturn(MessageTestFactory.create());
prepareMockServer().andExpect(jsonPath("$.replyAction").value(REPLY_OPTION.toValue())); prepareMockServer().andExpect(jsonPath("$.replyAction").value(REPLY_OPTION.toValue()));
service.sendMessage(PostfachNachrichtTestFactory.create()); service.sendMessage(postfachNachricht);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment