Search in sources :

Example 1 with SerPropertiesDto

use of org.talend.components.service.rest.dto.SerPropertiesDto in project components by Talend.

the class PropertiesControllerImpl method serialize.

@Override
public SerPropertiesDto serialize(UiSpecsPropertiesDto propertiesContainer) {
    Properties properties = propertiesHelpers.propertiesFromDto(propertiesContainer);
    if (properties == null) {
        return new SerPropertiesDto();
    }
    SerPropertiesDto serPropertiesDto = new SerPropertiesDto();
    serPropertiesDto.setProperties(properties.toSerialized());
    return serPropertiesDto;
}
Also used : DatasetProperties(org.talend.components.common.dataset.DatasetProperties) DatastoreProperties(org.talend.components.common.datastore.DatastoreProperties) Properties(org.talend.daikon.properties.Properties) SerPropertiesDto(org.talend.components.service.rest.dto.SerPropertiesDto)

Example 2 with SerPropertiesDto

use of org.talend.components.service.rest.dto.SerPropertiesDto in project components by Talend.

the class AbstractSpringIntegrationTests method buildTestDataStoreSerProps.

protected SerPropertiesDto buildTestDataStoreSerProps() throws java.io.IOException {
    SerPropertiesDto formDataContainer = new SerPropertiesDto();
    formDataContainer.setProperties(new MockDatastoreProperties("").init().toSerialized());
    return formDataContainer;
}
Also used : SerPropertiesDto(org.talend.components.service.rest.dto.SerPropertiesDto) MockDatastoreProperties(org.talend.components.service.rest.mock.MockDatastoreProperties)

Example 3 with SerPropertiesDto

use of org.talend.components.service.rest.dto.SerPropertiesDto in project components by Talend.

the class AbstractSpringIntegrationTests method buildTestDataSetSerProps.

protected SerPropertiesDto buildTestDataSetSerProps() throws java.io.IOException {
    SerPropertiesDto formDataContainer = new SerPropertiesDto();
    MockDatasetProperties mockDatasetProperties = new MockDatasetProperties("foo");
    mockDatasetProperties.tag.setValue("tata");
    mockDatasetProperties.tagId.setValue(256);
    MockDatastoreProperties mockDatastoreProperties = new MockDatastoreProperties("bar");
    formDataContainer.setDependencies(singletonList(mockDatastoreProperties.toSerialized()));
    formDataContainer.setProperties(mockDatasetProperties.toSerialized());
    return formDataContainer;
}
Also used : MockDatasetProperties(org.talend.components.service.rest.mock.MockDatasetProperties) SerPropertiesDto(org.talend.components.service.rest.dto.SerPropertiesDto) MockDatastoreProperties(org.talend.components.service.rest.mock.MockDatastoreProperties)

Example 4 with SerPropertiesDto

use of org.talend.components.service.rest.dto.SerPropertiesDto in project components by Talend.

the class FullExampleComponentTestIT method createDatasetDatastoreSerPropertiesDto.

private SerPropertiesDto createDatasetDatastoreSerPropertiesDto() {
    FullExampleDatastoreProperties datastoreProperties = new FullExampleDatastoreProperties("foo");
    datastoreProperties.init();
    datastoreProperties.tag.setValue("DERBY");
    FullExampleDatasetProperties datasetProperties = new FullExampleDatasetProperties("bar");
    datasetProperties.init();
    datasetProperties.sourceType.setValue(SourceType.SOQL_QUERY);
    datasetProperties.moduleName.setValue("Account");
    datasetProperties.query.setValue("SELECT * FROM users");
    SerPropertiesDto serPropertiesDto = new SerPropertiesDto();
    serPropertiesDto.setProperties(datasetProperties.toSerialized());
    serPropertiesDto.setDependencies(Collections.singletonList(datastoreProperties.toSerialized()));
    return serPropertiesDto;
}
Also used : FullExampleDatasetProperties(org.talend.components.service.rest.fullexample.dataset.FullExampleDatasetProperties) FullExampleDatastoreProperties(org.talend.components.service.rest.fullexample.datastore.FullExampleDatastoreProperties) SerPropertiesDto(org.talend.components.service.rest.dto.SerPropertiesDto)

Example 5 with SerPropertiesDto

use of org.talend.components.service.rest.dto.SerPropertiesDto in project components by Talend.

the class FullExampleComponentTestIT method initializeFullExampleDatasetProperties.

@Test
public void initializeFullExampleDatasetProperties() throws java.io.IOException {
    SerPropertiesDto serPropertiesDto = createDatasetDatastoreSerPropertiesDto();
    // 
    given().content(serPropertiesDto).contentType(ServiceConstants.JSONIO_CONTENT_TYPE).accept(// 
    ServiceConstants.UI_SPEC_CONTENT_TYPE).expect().statusCode(200).log().ifError().when().post(// 
    getVersionPrefix() + "/properties/uispec").then().body("jsonSchema", // 
    notNullValue()).body("properties", // 
    notNullValue()).body("uiSchema", // 
    notNullValue()).body("properties.@definitionName", // 
    equalTo("FullExampleDataset")).body("uiSchema.moduleName.'ui:widget'", // 
    equalTo("hidden")).body("uiSchema.query.'ui:widget'", // 
    equalTo("textarea"));
}
Also used : SerPropertiesDto(org.talend.components.service.rest.dto.SerPropertiesDto) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

SerPropertiesDto (org.talend.components.service.rest.dto.SerPropertiesDto)12 Test (org.junit.Test)8 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)5 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)2 Response (com.jayway.restassured.response.Response)2 JDBCDatastoreProperties (org.talend.components.jdbc.datastore.JDBCDatastoreProperties)2 FullExampleDatastoreProperties (org.talend.components.service.rest.fullexample.datastore.FullExampleDatastoreProperties)2 MockDatastoreProperties (org.talend.components.service.rest.mock.MockDatastoreProperties)2 DatasetProperties (org.talend.components.common.dataset.DatasetProperties)1 DatastoreProperties (org.talend.components.common.datastore.DatastoreProperties)1 JDBCDatasetProperties (org.talend.components.jdbc.dataset.JDBCDatasetProperties)1 FullExampleDatasetProperties (org.talend.components.service.rest.fullexample.dataset.FullExampleDatasetProperties)1 MockDatasetProperties (org.talend.components.service.rest.mock.MockDatasetProperties)1 Properties (org.talend.daikon.properties.Properties)1