@Test
public void mergeContextMergesExpectedTemplateAndContext() {

    // given
    var templatePath = "TestTemplate.vm";
    var contextMap = Map.<String, Object>of("key1", "value1", "key2", 2L);
    var expectedResult = "Nice context merge!";
    given(velocityEngineMock.getTemplate(templatePath)).willReturn(velocityTemplateMock);
    doAnswer(invocation -> {
        var actualWriter = (StringWriter) invocation.getArgument(1);
        actualWriter.append(expectedResult);
        return null;
    }).when(velocityTemplateMock).merge(
            argThat(new VelocityContextArgumentMatcher(contextMap)),
            argThat(new StringWriterArgumentMatcher(""))
    );
    // when
    var actualResult = velocityMailTemplateService.mergeTemplate(templatePath, contextMap);
    // then
    assertThat(actualResult).isEqualTo(expectedResult);
}