test_class.declarator: csvFormatUtils = new CSVFormatUtils()
test_class.modifier: @InjectMocks
      private
test_class.original_string: @InjectMocks
      private CSVFormatUtils csvFormatUtils = new CSVFormatUtils();
test_class.type: CSVFormatUtils
test_class.var_name: csvFormatUtils
test_class.declarator: mapper = new ObjectMapper()
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ObjectMapper mapper = new ObjectMapper();
test_class.type: ObjectMapper
test_class.var_name: mapper
test_class.file: dataprep-backend-service/src/test/java/org/talend/dataprep/schema/csv/CSVFormatUtilsTest.java
test_class.identifier: CSVFormatUtilsTest
test_case.body: @Test
      public void should_compile_parameters() {
          // given
          ReflectionTestUtils.setField(csvFormatUtils, "defaultTextEnclosure", "\"");
          ReflectionTestUtils.setField(csvFormatUtils, "defaultEscapeChar", "\u0000");
  
          final Map<String, String> entryParameters = initMapParam();
  
          final Separator separator = new Separator("|".charAt(0));
  
          // when
          csvFormatUtils.compileParameterProperties(separator, entryParameters);
  
          // then
          assertEquals(5, entryParameters.size());
          assertEquals("\u0000", entryParameters.get(ESCAPE_CHAR));
          assertEquals("\"", entryParameters.get(TEXT_ENCLOSURE_CHAR));
          assertEquals("|", entryParameters.get(SEPARATOR_PARAMETER));
          assertEquals("0", entryParameters.get(HEADER_NB_LINES_PARAMETER));
          assertEquals(null, entryParameters.get(HEADER_COLUMNS_PARAMETER));
      }
test_case.class_method_signature: CSVFormatUtilsTest.should_compile_parameters()
test_case.full_signature: @Test public void should_compile_parameters()
test_case.identifier: should_compile_parameters
test_case.invocations: setField setField initMapParam charAt compileParameterProperties assertEquals size assertEquals get assertEquals get assertEquals get assertEquals get assertEquals get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void should_compile_parameters()
focal_class.declarator: mapper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private ObjectMapper mapper;
focal_class.type: ObjectMapper
focal_class.var_name: mapper
focal_class.declarator: defaultTextEnclosure
focal_class.modifier: @Value("${default.import.text.enclosure:\"}")
      private
focal_class.original_string: @Value("${default.import.text.enclosure:\"}")
      private String defaultTextEnclosure;
focal_class.type: String
focal_class.var_name: defaultTextEnclosure
focal_class.declarator: defaultEscapeChar
focal_class.modifier: @Value("${default.import.text.escape:\u0000}")
      private
focal_class.original_string: @Value("${default.import.text.escape:\u0000}")
      private String defaultEscapeChar;
focal_class.type: String
focal_class.var_name: defaultEscapeChar
focal_class.file: dataprep-backend-service/src/main/java/org/talend/dataprep/schema/csv/CSVFormatUtils.java
focal_class.identifier: CSVFormatUtils
focal_class.class_method_signature: CSVFormatUtils.retrieveHeader(Map<String, String> parameters)
focal_class.full_signature:  List<String> retrieveHeader(Map<String, String> parameters)
focal_class.identifier: retrieveHeader
focal_class.parameters: (Map<String, String> parameters)
focal_class.return: List<String>
focal_class.signature: List<String> retrieveHeader(Map<String, String> parameters)
focal_class.class_method_signature: CSVFormatUtils.compileParameterProperties(Separator separator, Map<String, String> updatedParameters)
focal_class.full_signature:  Map<String, String> compileParameterProperties(Separator separator, Map<String, String> updatedParameters)
focal_class.identifier: compileParameterProperties
focal_class.parameters: (Separator separator, Map<String, String> updatedParameters)
focal_class.return: Map<String, String>
focal_class.signature: Map<String, String> compileParameterProperties(Separator separator, Map<String, String> updatedParameters)
focal_method.body: Map<String, String> compileParameterProperties(Separator separator, Map<String, String> updatedParameters) {
  
          List<String> header = separator.getHeaders().stream().map(Pair::getKey).collect(Collectors.toList());
          // header
          String jsonHeader;
          try {
              jsonHeader = mapper.writeValueAsString(header);
          } catch (Exception e) {
              throw new TDPException(UNABLE_TO_SERIALIZE_TO_JSON, e);
          }
          updatedParameters.put(HEADER_COLUMNS_PARAMETER, jsonHeader);
  
          updatedParameters.put(HEADER_NB_LINES_PARAMETER, separator.isFirstLineAHeader() ? "1" : "0");
          // separator
          updatedParameters.put(SEPARATOR_PARAMETER, String.valueOf(separator.getSeparator()));
  
          // if no parameter set set take the default one
          updatedParameters.putIfAbsent(TEXT_ENCLOSURE_CHAR, defaultTextEnclosure);
          updatedParameters.putIfAbsent(ESCAPE_CHAR, defaultEscapeChar);
  
          return updatedParameters;
      }
focal_method.class_method_signature: CSVFormatUtils.compileParameterProperties(Separator separator, Map<String, String> updatedParameters)
focal_method.full_signature:  Map<String, String> compileParameterProperties(Separator separator, Map<String, String> updatedParameters)
focal_method.identifier: compileParameterProperties
focal_method.invocations: collect map stream getHeaders toList writeValueAsString put put isFirstLineAHeader put valueOf getSeparator putIfAbsent putIfAbsent
focal_method.parameters: (Separator separator, Map<String, String> updatedParameters)
focal_method.return: Map<String, String>
focal_method.signature: Map<String, String> compileParameterProperties(Separator separator, Map<String, String> updatedParameters)