Search in sources :

Example 6 with CQExternal

use of com.bakdata.conquery.apiv1.query.concept.specific.external.CQExternal in project conquery by bakdata.

the class DefaultLabelTest method autoLabelComplexQueryNullLabels.

@ParameterizedTest
@CsvSource({ "de,Hochgeladene-Liste Anfrage Default-Concept Concept2 Concept3", "en,Uploaded-List Query Default-Concept Concept2 Concept3" })
void autoLabelComplexQueryNullLabels(Locale locale, String autoLabel) {
    I18n.LOCALE.set(locale);
    final ManagedQuery managedQuery = new ManagedQuery(null, null, DATASET);
    managedQuery.setQueryId(UUID.randomUUID());
    CQAnd and = new CQAnd();
    CQConcept concept1 = new CQConcept();
    concept1.setLabel(null);
    concept1.setElements(List.of(CONCEPT));
    CQConcept concept2 = makeCQConcept("Concept2");
    CQConcept concept3 = makeCQConcept("Concept3");
    and.setChildren(List.of(new CQExternal(List.of(), new String[0][0]), new CQReusedQuery(managedQuery.getId()), concept1, concept2, concept3));
    ConceptQuery cq = new ConceptQuery(and);
    ManagedQuery mQuery = cq.toManagedExecution(user, DATASET);
    mQuery.setLabel(mQuery.makeAutoLabel(getPrintSettings(locale)));
    assertThat(mQuery.getLabel()).isEqualTo(autoLabel + AUTO_LABEL_SUFFIX);
    assertThat(mQuery.getLabelWithoutAutoLabelSuffix()).isEqualTo(autoLabel);
}
Also used : CQReusedQuery(com.bakdata.conquery.apiv1.query.concept.specific.CQReusedQuery) CQConcept(com.bakdata.conquery.apiv1.query.concept.specific.CQConcept) CQExternal(com.bakdata.conquery.apiv1.query.concept.specific.external.CQExternal) ManagedQuery(com.bakdata.conquery.models.query.ManagedQuery) CQAnd(com.bakdata.conquery.apiv1.query.concept.specific.CQAnd) ConceptQuery(com.bakdata.conquery.apiv1.query.ConceptQuery) CsvSource(org.junit.jupiter.params.provider.CsvSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

CQExternal (com.bakdata.conquery.apiv1.query.concept.specific.external.CQExternal)6 ConceptQuery (com.bakdata.conquery.apiv1.query.ConceptQuery)5 ManagedQuery (com.bakdata.conquery.models.query.ManagedQuery)4 CQConcept (com.bakdata.conquery.apiv1.query.concept.specific.CQConcept)3 CQReusedQuery (com.bakdata.conquery.apiv1.query.concept.specific.CQReusedQuery)3 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)3 CsvSource (org.junit.jupiter.params.provider.CsvSource)3 Query (com.bakdata.conquery.apiv1.query.Query)2 CQAnd (com.bakdata.conquery.apiv1.query.concept.specific.CQAnd)2 C10N (c10n.C10N)1 ExecutionStatus (com.bakdata.conquery.apiv1.ExecutionStatus)1 FullExecutionStatus (com.bakdata.conquery.apiv1.FullExecutionStatus)1 ExternalUploadResult (com.bakdata.conquery.apiv1.query.ExternalUploadResult)1 QueryDescription (com.bakdata.conquery.apiv1.query.QueryDescription)1 SecondaryIdQuery (com.bakdata.conquery.apiv1.query.SecondaryIdQuery)1 CQElementC10n (com.bakdata.conquery.internationalization.CQElementC10n)1 CPSType (com.bakdata.conquery.io.cps.CPSType)1 MetaStorage (com.bakdata.conquery.io.storage.MetaStorage)1 Subject (com.bakdata.conquery.models.auth.entities.Subject)1 User (com.bakdata.conquery.models.auth.entities.User)1