test_class.declarator: factory
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private TransformerFactory factory;
test_class.type: TransformerFactory
test_class.var_name: factory
test_class.file: dataprep-transformation/src/test/java/org/talend/dataprep/transformation/api/transformer/TransformerFactoryTest.java
test_class.identifier: TransformerFactoryTest
test_class.superclass: extends TransformationBaseTest
test_case.body: @Test
      public void getExporter_csv_exporter_should_write_csv_format() throws Exception {
          // given
          Map<String, String> arguments = new HashMap<>();
          arguments.put(ExportFormat.PREFIX + CSVFormat.ParametersCSV.FIELDS_DELIMITER, ";");
          arguments.put(ExportFormat.PREFIX + CSVFormat.ParametersCSV.ENCLOSURE_MODE,
                  CSVFormat.ParametersCSV.ENCLOSURE_ALL_FIELDS);
          final OutputStream outputStream = new ByteArrayOutputStream();
          final Configuration configuration = Configuration
                  .builder() //
                  .args(arguments) //
                  .format(CSV) //
                  .output(outputStream) //
                  .actions(IOUtils.toString(TransformerFactoryTest.class.getResourceAsStream("upper_case_firstname.json"),
                          UTF_8)) //
                  .build();
          final Transformer transformer = factory.get(configuration);
          final String expectedCsv = IOUtils.toString(
                  TransformerFactoryTest.class.getResourceAsStream("expected_export_preparation_uppercase_firstname.csv"),
                  UTF_8);
  
          final InputStream inputStream =
                  TransformerFactoryTest.class.getResourceAsStream("../../format/export_dataset.json");
          try (JsonParser parser = mapper.getFactory().createParser(inputStream)) {
              final DataSet dataSet = mapper.readerFor(DataSet.class).readValue(parser);
  
              // when
              transformer.buildExecutable(dataSet, configuration).execute();
              // then
              assertThat(outputStream.toString()).isEqualTo(expectedCsv);
          }
  
      }
test_case.class_method_signature: TransformerFactoryTest.getExporter_csv_exporter_should_write_csv_format()
test_case.full_signature: @Test public void getExporter_csv_exporter_should_write_csv_format()
test_case.identifier: getExporter_csv_exporter_should_write_csv_format
test_case.invocations: put put build actions output format args builder toString getResourceAsStream get toString getResourceAsStream getResourceAsStream createParser getFactory readValue readerFor execute buildExecutable isEqualTo assertThat toString
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void getExporter_csv_exporter_should_write_csv_format()
focal_class.declarator: context
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private ApplicationContext context;
focal_class.type: ApplicationContext
focal_class.var_name: context
focal_class.file: dataprep-transformation/src/main/java/org/talend/dataprep/transformation/api/transformer/TransformerFactory.java
focal_class.identifier: TransformerFactory
focal_class.class_method_signature: TransformerFactory.TransformerFactory()
focal_class.full_signature: private  TransformerFactory()
focal_class.identifier: TransformerFactory
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  TransformerFactory()
focal_class.class_method_signature: TransformerFactory.get(Configuration configuration)
focal_class.full_signature: public Transformer get(Configuration configuration)
focal_class.identifier: get
focal_class.modifiers: public
focal_class.parameters: (Configuration configuration)
focal_class.return: Transformer
focal_class.signature: Transformer get(Configuration configuration)
focal_method.body: public Transformer get(Configuration configuration) {
          List<Transformer> electedTransformers = context
                  .getBeansOfType(Transformer.class)
                  .values()
                  .stream() //
                  .filter(transformer -> transformer.accept(configuration)) //
                  .collect(Collectors.toList());
          if (electedTransformers.isEmpty()) {
              throw new IllegalStateException("No transformers eligible for configuration.");
          }
          if (electedTransformers.size() > 1) {
              throw new IllegalStateException("Too many transformers eligible for configuration (got "
                      + electedTransformers.size() + ": " + Arrays.toString(electedTransformers.toArray()) + ")");
          }
          return electedTransformers.get(0);
      }
focal_method.class_method_signature: TransformerFactory.get(Configuration configuration)
focal_method.full_signature: public Transformer get(Configuration configuration)
focal_method.identifier: get
focal_method.invocations: collect filter stream values getBeansOfType accept toList isEmpty size size toString toArray get
focal_method.modifiers: public
focal_method.parameters: (Configuration configuration)
focal_method.return: Transformer
focal_method.signature: Transformer get(Configuration configuration)