DefaultBatchFactory implements BatchFactory { @Override public Batch createBatch(Map<String, String> properties, final org.sonarsource.scanner.api.internal.batch.LogOutput logOutput) { EnvironmentInformation env = new EnvironmentInformation(properties.get(SCANNER_APP_KEY), properties.get(SCANNER_APP_VERSION_KEY)); return Batch.builder() .setEnvironment(env) .setGlobalProperties(properties) .setLogOutput((formattedMessage, level) -> logOutput.log(formattedMessage, LogOutput.Level.valueOf(level.name()))) .build(); }  @Override Batch createBatch(Map<String, String> properties, final org.sonarsource.scanner.api.internal.batch.LogOutput logOutput);  }
@Test public void should_create_batch() { props.put("sonar.projectBaseDir", "src/test/java_sample"); props.put("sonar.projectKey", "sample"); props.put("sonar.projectName", "Sample"); props.put("sonar.projectVersion", "1.0"); props.put("sonar.sources", "src"); Batch batch = factory.createBatch(props, (m, l) -> { }); assertThat(batch).isNotNull(); }