use of com.bakdata.conquery.models.query.resultinfo.ResultInfo in project conquery by bakdata.
the class SecondaryIdQuery method getResultInfos.
@Override
public List<ResultInfo> getResultInfos() {
List<ResultInfo> resultInfos = new ArrayList<>();
resultInfos.add(new SimpleResultInfo(secondaryId.getName(), ResultType.IdT.INSTANCE));
resultInfos.addAll(query.getResultInfos());
return resultInfos;
}
use of com.bakdata.conquery.models.query.resultinfo.ResultInfo in project conquery by bakdata.
the class FormTest method checkResults.
private void checkResults(StandaloneSupport standaloneSupport, ManagedForm managedForm, User user) throws IOException {
Map<String, List<ManagedQuery>> managedMapping = managedForm.getSubQueries();
IdPrinter idPrinter = standaloneSupport.getConfig().getFrontend().getQueryUpload().getIdPrinter(user, managedForm, standaloneSupport.getNamespace());
final ConqueryConfig config = standaloneSupport.getConfig();
PrintSettings PRINT_SETTINGS = new PrintSettings(false, Locale.ENGLISH, standaloneSupport.getDatasetsProcessor().getDatasetRegistry(), config, idPrinter::createId);
CsvLineStreamRenderer renderer = new CsvLineStreamRenderer(config.getCsv().createWriter(), PRINT_SETTINGS);
for (Map.Entry<String, List<ManagedQuery>> managed : managedMapping.entrySet()) {
List<ResultInfo> resultInfos = managed.getValue().get(0).getResultInfos();
log.info("{} CSV TESTING: {}", getLabel(), managed.getKey());
List<String> actual = renderer.toStream(config.getFrontend().getQueryUpload().getIdResultInfos(), resultInfos, managed.getValue().stream().flatMap(ManagedQuery::streamResults)).collect(Collectors.toList());
assertThat(actual).as("Checking result " + managed.getKey()).containsExactlyInAnyOrderElementsOf(In.stream(expectedCsv.get(managed.getKey()).stream()).withUTF8().readLines());
}
}
Aggregations