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()));
}
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());
}
Aggregations