use of org.talend.components.service.rest.dto.SerPropertiesDto in project components by Talend.
the class FullExampleComponentTestIT method testAfterDatastoreCalled.
@Test
public void testAfterDatastoreCalled() 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.testAfterDatastoreTrigger", //
equalTo("bar"));
}
use of org.talend.components.service.rest.dto.SerPropertiesDto in project components by Talend.
the class RuntimeControllerImplTest method validateConnectionJsonio.
@Test
public void validateConnectionJsonio() throws Exception {
SerPropertiesDto propertiesDto = buildTestDataStoreSerProps();
//
given().accept(APPLICATION_JSON_UTF8_VALUE).with().content(//
propertiesDto).contentType(//
ServiceConstants.JSONIO_CONTENT_TYPE).when().post(//
getVersionPrefix() + "/runtimes/check").then().statusCode(HttpStatus.OK.value()).log().ifError().assertThat().body(//
notNullValue()).assertThat().body(instanceOf(String.class));
}
use of org.talend.components.service.rest.dto.SerPropertiesDto in project components by Talend.
the class JdbcComponentTestIT method initializeJDBCDatastoreProperties.
@Test
public void initializeJDBCDatastoreProperties() throws java.io.IOException {
// given
SerPropertiesDto propDto = new SerPropertiesDto();
propDto.setProperties(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());
// should resemble jdbc_data_store_form.json
assertNotNull(jdbcProperties.get("jsonSchema"));
assertNotNull(jdbcProperties.get("properties"));
assertNotNull(jdbcProperties.get("uiSchema"));
assertEquals("JDBCDatastore", jdbcProperties.get("properties").get("@definitionName").textValue());
}
use of org.talend.components.service.rest.dto.SerPropertiesDto in project components by Talend.
the class FullExampleComponentTestIT method initializeFullExampleDatastoreProperties.
@Test
public void initializeFullExampleDatastoreProperties() throws java.io.IOException {
SerPropertiesDto serProperties = new SerPropertiesDto();
serProperties.setProperties(new FullExampleDatastoreProperties("").init().toSerialized());
//
given().content(serProperties).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("FullExampleDatastore"));
}
use of org.talend.components.service.rest.dto.SerPropertiesDto in project components by Talend.
the class RuntimeControllerImplTest method getDatasetSchemaJsonIo.
@Test
public void getDatasetSchemaJsonIo() throws Exception {
// given
SerPropertiesDto formDataContainer = buildTestDataSetSerProps();
//
given().accept(APPLICATION_JSON_UTF8_VALUE).with().content(//
formDataContainer).contentType(//
ServiceConstants.JSONIO_CONTENT_TYPE).when().post(//
getVersionPrefix() + "/runtimes/schema").then().statusCode(200).log().ifError().assertThat().body(equalTo(MockDatasetRuntime.getSchemaJsonRepresentation()));
}
Aggregations