test_class.declarator: velocityEngineMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private VelocityEngine velocityEngineMock;
test_class.type: VelocityEngine
test_class.var_name: velocityEngineMock
test_class.declarator: velocityTemplateMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private Template velocityTemplateMock;
test_class.type: Template
test_class.var_name: velocityTemplateMock
test_class.declarator: velocityMailTemplateService
test_class.modifier: private
test_class.original_string: private VelocityMailTemplateService velocityMailTemplateService;
test_class.type: VelocityMailTemplateService
test_class.var_name: velocityMailTemplateService
test_class.file: backend/project-board/src/test/java/de/adesso/projectboard/adapter/mail/VelocityMailTemplateServiceTest.java
test_class.identifier: VelocityMailTemplateServiceTest
test_case.body: @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);
      }
test_case.class_method_signature: VelocityMailTemplateServiceTest.mergeContextMergesExpectedTemplateAndContext()
test_case.full_signature: @Test public void mergeContextMergesExpectedTemplateAndContext()
test_case.identifier: mergeContextMergesExpectedTemplateAndContext
test_case.invocations: of willReturn given getTemplate merge when doAnswer getArgument append argThat argThat mergeTemplate isEqualTo assertThat
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void mergeContextMergesExpectedTemplateAndContext()
focal_class.declarator: SUBJECT_DELIMITER = "--!--SUBJECT--!--"
focal_class.modifier: static final
focal_class.original_string: static final String SUBJECT_DELIMITER = "--!--SUBJECT--!--";
focal_class.type: String
focal_class.var_name: SUBJECT_DELIMITER
focal_class.declarator: TEXT_DELIMITER = "--!--TEXT--!--"
focal_class.modifier: static final
focal_class.original_string: static final String TEXT_DELIMITER = "--!--TEXT--!--";
focal_class.type: String
focal_class.var_name: TEXT_DELIMITER
focal_class.declarator: velocityEngine
focal_class.modifier: private final
focal_class.original_string: private final VelocityEngine velocityEngine;
focal_class.type: VelocityEngine
focal_class.var_name: velocityEngine
focal_class.file: backend/project-board/src/main/java/de/adesso/projectboard/adapter/mail/VelocityMailTemplateService.java
focal_class.identifier: VelocityMailTemplateService
focal_class.class_method_signature: VelocityMailTemplateService.VelocityMailTemplateService(VelocityEngine velocityEngine)
focal_class.full_signature: public  VelocityMailTemplateService(VelocityEngine velocityEngine)
focal_class.identifier: VelocityMailTemplateService
focal_class.modifiers: public
focal_class.parameters: (VelocityEngine velocityEngine)
focal_class.signature:  VelocityMailTemplateService(VelocityEngine velocityEngine)
focal_class.class_method_signature: VelocityMailTemplateService.mergeTemplate(@NotNull String templatePath, Map<String, Object> contextMap)
focal_class.full_signature: public String mergeTemplate(@NotNull String templatePath, Map<String, Object> contextMap)
focal_class.identifier: mergeTemplate
focal_class.modifiers: public
focal_class.parameters: (@NotNull String templatePath, Map<String, Object> contextMap)
focal_class.return: String
focal_class.signature: String mergeTemplate(@NotNull String templatePath, Map<String, Object> contextMap)
focal_class.class_method_signature: VelocityMailTemplateService.getSubjectAndText(@NotNull String templatePath, Map<String, Object> contextMap)
focal_class.full_signature: public Pair<String, String> getSubjectAndText(@NotNull String templatePath, Map<String, Object> contextMap)
focal_class.identifier: getSubjectAndText
focal_class.modifiers: public
focal_class.parameters: (@NotNull String templatePath, Map<String, Object> contextMap)
focal_class.return: Pair<String, String>
focal_class.signature: Pair<String, String> getSubjectAndText(@NotNull String templatePath, Map<String, Object> contextMap)
focal_class.class_method_signature: VelocityMailTemplateService.getSubStringBetweenDelimiters(String origin, String firstDelimiter, String secondDelimiter)
focal_class.full_signature:  String getSubStringBetweenDelimiters(String origin, String firstDelimiter, String secondDelimiter)
focal_class.identifier: getSubStringBetweenDelimiters
focal_class.parameters: (String origin, String firstDelimiter, String secondDelimiter)
focal_class.return: String
focal_class.signature: String getSubStringBetweenDelimiters(String origin, String firstDelimiter, String secondDelimiter)
focal_method.body: public String mergeTemplate(@NotNull String templatePath, Map<String, Object> contextMap) {
          var velocityTemplate = velocityEngine.getTemplate(templatePath);
          var velocityContext = new VelocityContext(new HashMap<>(contextMap));
          var writer = new StringWriter();
          velocityTemplate.merge(velocityContext, writer);
  
          return writer.toString();
      }
focal_method.class_method_signature: VelocityMailTemplateService.mergeTemplate(@NotNull String templatePath, Map<String, Object> contextMap)
focal_method.full_signature: public String mergeTemplate(@NotNull String templatePath, Map<String, Object> contextMap)
focal_method.identifier: mergeTemplate
focal_method.invocations: getTemplate merge toString
focal_method.modifiers: public
focal_method.parameters: (@NotNull String templatePath, Map<String, Object> contextMap)
focal_method.return: String
focal_method.signature: String mergeTemplate(@NotNull String templatePath, Map<String, Object> contextMap)