Search in sources :

Example 11 with SerPropertiesDto

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

the class RuntimeControllerImplTest method getDatasetDataJsonio.

@Test
public void getDatasetDataJsonio() throws Exception {
    // given
    SerPropertiesDto formDataContainer = buildTestDataSetSerProps();
    // 
    given().accept(APPLICATION_JSON_UTF8_VALUE).with().content(// 
    formDataContainer).contentType(// 
    ServiceConstants.JSONIO_CONTENT_TYPE).when().post(// 
    getVersionPrefix() + "/runtimes/data").then().statusCode(200).log().ifError().assertThat().body(equalTo(MockDatasetRuntime.getRecordJsonRepresentation()));
}
Also used : SerPropertiesDto(org.talend.components.service.rest.dto.SerPropertiesDto) Test(org.junit.Test)

Example 12 with SerPropertiesDto

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

the class JdbcComponentTestIT method initializeJDBCDatasetProperties.

@Test
public void initializeJDBCDatasetProperties() throws java.io.IOException {
    // given
    SerPropertiesDto propDto = new SerPropertiesDto();
    propDto.setProperties(new JDBCDatasetProperties("").init().toSerialized());
    propDto.setDependencies(singletonList(new JDBCDatastoreProperties("").init().toSerialized()));
    // when
    Response response = // 
    given().content(propDto).contentType(ServiceConstants.JSONIO_CONTENT_TYPE).accept(// 
    ServiceConstants.UI_SPEC_CONTENT_TYPE).expect().statusCode(200).log().ifError().post(getVersionPrefix() + "/properties/uispec");
    // then
    ObjectNode jdbcProperties = mapper.readerFor(ObjectNode.class).readValue(response.asInputStream());
    assertNotNull(jdbcProperties.get("jsonSchema"));
    assertNotNull(jdbcProperties.get("properties"));
    assertNotNull(jdbcProperties.get("uiSchema"));
    assertEquals("JDBCDataset", jdbcProperties.get("properties").get("@definitionName").textValue());
}
Also used : Response(com.jayway.restassured.response.Response) ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) JDBCDatasetProperties(org.talend.components.jdbc.dataset.JDBCDatasetProperties) JDBCDatastoreProperties(org.talend.components.jdbc.datastore.JDBCDatastoreProperties) 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