use of org.talend.components.jira.tjirainput.TJiraInputProperties in project components by Talend.
the class JiraSourceTest 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");
inputProperties = new TJiraInputProperties("root");
inputProperties.connection.hostUrl.setValue("hostValue");
inputProperties.connection.basicAuthentication.userId.setValue("userIdValue");
inputProperties.connection.basicAuthentication.password.setValue("passwordValue");
inputProperties.resource.setValue(Resource.ISSUE);
inputProperties.schema.schema.setValue(schema);
inputProperties.jql.setValue("jqlValue");
inputProperties.batchSize.setValue(50);
inputProperties.projectId.setValue("projectIdValue");
}
use of org.talend.components.jira.tjirainput.TJiraInputProperties in project components by Talend.
the class JiraSource method initialize.
/**
* Saves component properties in this object
*
* @param container {@link RuntimeContainer} instance
* @param properties component properties
*/
@Override
public ValidationResult initialize(RuntimeContainer container, ComponentProperties properties) {
ValidationResult validate = super.initialize(container, properties);
if (validate.getStatus() == Result.ERROR) {
return validate;
}
TJiraInputProperties inputProperties = (TJiraInputProperties) properties;
this.jql = inputProperties.jql.getStringValue();
this.batchSize = inputProperties.batchSize.getValue();
this.projectId = inputProperties.projectId.getStringValue();
this.resourceType = inputProperties.resource.getValue();
return ValidationResult.OK;
}
Aggregations