Search in sources :

Example 1 with AbsoluteMode

use of com.bakdata.conquery.apiv1.forms.export_form.AbsoluteMode in project conquery by bakdata.

the class SerializationTests method formConfig.

@Test
public void formConfig() throws JSONException, IOException {
    final CentralRegistry registry = new CentralRegistry();
    final Dataset dataset = new Dataset("test-dataset");
    registry.register(dataset);
    ExportForm form = new ExportForm();
    AbsoluteMode mode = new AbsoluteMode();
    form.setTimeMode(mode);
    mode.setForm(form);
    mode.setFeatures(List.of(new CQConcept()));
    ObjectMapper mapper = FormConfigProcessor.getMAPPER();
    JsonNode values = mapper.valueToTree(form);
    FormConfig formConfig = new FormConfig(form.getClass().getAnnotation(CPSType.class).id(), values);
    formConfig.setDataset(dataset);
    SerializationTestUtil.forType(FormConfig.class).registry(registry).test(formConfig);
}
Also used : FormConfig(com.bakdata.conquery.models.forms.configs.FormConfig) AbsoluteMode(com.bakdata.conquery.apiv1.forms.export_form.AbsoluteMode) Dataset(com.bakdata.conquery.models.datasets.Dataset) CQConcept(com.bakdata.conquery.apiv1.query.concept.specific.CQConcept) JsonNode(com.fasterxml.jackson.databind.JsonNode) CentralRegistry(com.bakdata.conquery.models.identifiable.CentralRegistry) ExportForm(com.bakdata.conquery.apiv1.forms.export_form.ExportForm) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Test(org.junit.jupiter.api.Test) IdMapSerialisationTest(com.bakdata.conquery.models.identifiable.IdMapSerialisationTest)

Example 2 with AbsoluteMode

use of com.bakdata.conquery.apiv1.forms.export_form.AbsoluteMode in project conquery by bakdata.

the class FormConfigTest method setupTest.

@BeforeEach
public void setupTest() {
    final ManagedQuery managedQuery = new ManagedQuery(null, null, dataset);
    managedQuery.setQueryId(UUID.randomUUID());
    form = new ExportForm();
    AbsoluteMode mode = new AbsoluteMode();
    form.setTimeMode(mode);
    form.setQueryGroupId(managedQuery.getId());
    mode.setForm(form);
    mode.setFeatures(List.of(new CQConcept()));
    user = new User("test", "test", storage);
    storage.addUser(user);
}
Also used : User(com.bakdata.conquery.models.auth.entities.User) AbsoluteMode(com.bakdata.conquery.apiv1.forms.export_form.AbsoluteMode) CQConcept(com.bakdata.conquery.apiv1.query.concept.specific.CQConcept) ManagedQuery(com.bakdata.conquery.models.query.ManagedQuery) ExportForm(com.bakdata.conquery.apiv1.forms.export_form.ExportForm) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

AbsoluteMode (com.bakdata.conquery.apiv1.forms.export_form.AbsoluteMode)2 ExportForm (com.bakdata.conquery.apiv1.forms.export_form.ExportForm)2 CQConcept (com.bakdata.conquery.apiv1.query.concept.specific.CQConcept)2 User (com.bakdata.conquery.models.auth.entities.User)1 Dataset (com.bakdata.conquery.models.datasets.Dataset)1 FormConfig (com.bakdata.conquery.models.forms.configs.FormConfig)1 CentralRegistry (com.bakdata.conquery.models.identifiable.CentralRegistry)1 IdMapSerialisationTest (com.bakdata.conquery.models.identifiable.IdMapSerialisationTest)1 ManagedQuery (com.bakdata.conquery.models.query.ManagedQuery)1 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1 Test (org.junit.jupiter.api.Test)1