Search in sources :

Example 6 with TJiraOutputProperties

use of org.talend.components.jira.tjiraoutput.TJiraOutputProperties in project components by Talend.

the class JiraSourceOrSinkTestIT method setUp.

/**
 * Prepares required instances for tests
 */
@Before
public void setUp() {
    AvroRegistry registry = new AvroRegistry();
    Schema stringSchema = registry.getConverter(String.class).getSchema();
    Schema.Field jsonField = new Schema.Field("json", stringSchema, null, null, Order.ASCENDING);
    schema = Schema.createRecord("jira", null, null, false, Collections.singletonList(jsonField));
    schema.addProp(TALEND_IS_LOCKED, "true");
    outputProperties = new TJiraOutputProperties("root");
    outputProperties.connection.hostUrl.setValue(HOST_PORT);
    outputProperties.connection.basicAuthentication.userId.setValue("userIdValue");
    outputProperties.connection.basicAuthentication.password.setValue("passwordValue");
    outputProperties.resource.setValue(Resource.ISSUE);
    outputProperties.schema.schema.setValue(schema);
    outputProperties.action.setValue(Action.INSERT);
}
Also used : AvroRegistry(org.talend.daikon.avro.AvroRegistry) Schema(org.apache.avro.Schema) TJiraOutputProperties(org.talend.components.jira.tjiraoutput.TJiraOutputProperties) Matchers.containsString(org.hamcrest.Matchers.containsString) Before(org.junit.Before)

Aggregations

TJiraOutputProperties (org.talend.components.jira.tjiraoutput.TJiraOutputProperties)6 Schema (org.apache.avro.Schema)3 Before (org.junit.Before)3 AvroRegistry (org.talend.daikon.avro.AvroRegistry)3 ValidationResult (org.talend.daikon.properties.ValidationResult)2 Matchers.containsString (org.hamcrest.Matchers.containsString)1 JiraSink (org.talend.components.jira.runtime.JiraSink)1 JiraWriteOperation (org.talend.components.jira.runtime.JiraWriteOperation)1 JiraWriter (org.talend.components.jira.runtime.writer.JiraWriter)1