use of org.talend.components.jira.Mode in project components by Talend.
the class TJiraOutputPropertiesTest method testSetupProperties.
/**
* Checks {@link TJiraOutputProperties#setupProperties()} sets correct initial property values
*/
@Test
public void testSetupProperties() {
AvroRegistry registry = new AvroRegistry();
Schema stringSchema = registry.getConverter(String.class).getSchema();
Schema.Field jsonField = new Schema.Field("json", stringSchema, null, null, Order.ASCENDING);
Schema expectedSchema = Schema.createRecord("jira", null, null, false, Collections.singletonList(jsonField));
expectedSchema.addProp(TALEND_IS_LOCKED, "true");
TJiraOutputProperties properties = new TJiraOutputProperties("root");
properties.setupProperties();
Action actionValue = properties.action.getValue();
Resource resourceValue = properties.resource.getValue();
boolean deleteSubtasksValue = properties.deleteSubtasks.getValue();
Mode modeValue = properties.mode.getValue();
Schema schema = properties.schema.schema.getValue();
assertThat(actionValue, equalTo(Action.INSERT));
assertThat(resourceValue, equalTo(Resource.ISSUE));
assertThat(deleteSubtasksValue, equalTo(true));
assertThat(modeValue, equalTo(Mode.ADVANCED));
assertThat(schema, equalTo(expectedSchema));
}