Search in sources :

Example 1 with JiraWriteOperation

use of org.talend.components.jira.runtime.JiraWriteOperation in project components by Talend.

the class JiraWriterTest method testGetWriteOperation.

/**
 * Checks {@link JiraWriter#getWriteOperation())} returns {@link WriteOperation} without any changes
 */
@Test
public void testGetWriteOperation() {
    JiraWriter writer = new JiraWriter(writeOperation);
    JiraWriteOperation actualWriteOperation = writer.getWriteOperation();
    assertEquals(writeOperation, actualWriteOperation);
}
Also used : JiraWriteOperation(org.talend.components.jira.runtime.JiraWriteOperation) Test(org.junit.Test)

Example 2 with JiraWriteOperation

use of org.talend.components.jira.runtime.JiraWriteOperation in project components by Talend.

the class JiraTestsHelper method createWriter.

/**
 * Creates {@link JiraWriter}, which will be tested
 *
 * @param hostPort Jira server url. Example: "http://192.168.99.100:8080/"
 * @param user Jira user
 * @param pass Jira user password
 * @param resource Project or Issue
 * @param action Insert/Update/Delete action
 */
public static JiraWriter createWriter(String hostPort, String user, String pass, Resource resource, Action action) {
    TJiraOutputProperties properties = new TJiraOutputProperties("root");
    properties.init();
    properties.connection.hostUrl.setValue(hostPort);
    properties.connection.basicAuthentication.userId.setValue(user);
    properties.connection.basicAuthentication.password.setValue(pass);
    properties.resource.setValue(resource);
    properties.action.setValue(action);
    JiraSink sink = new JiraSink();
    sink.initialize(null, properties);
    JiraWriteOperation writeOperation = (JiraWriteOperation) sink.createWriteOperation();
    writeOperation.initialize(null);
    JiraWriter jiraWriter = writeOperation.createWriter(null);
    return jiraWriter;
}
Also used : TJiraOutputProperties(org.talend.components.jira.tjiraoutput.TJiraOutputProperties) JiraSink(org.talend.components.jira.runtime.JiraSink) JiraWriteOperation(org.talend.components.jira.runtime.JiraWriteOperation) JiraWriter(org.talend.components.jira.runtime.writer.JiraWriter)

Aggregations

JiraWriteOperation (org.talend.components.jira.runtime.JiraWriteOperation)2 Test (org.junit.Test)1 JiraSink (org.talend.components.jira.runtime.JiraSink)1 JiraWriter (org.talend.components.jira.runtime.writer.JiraWriter)1 TJiraOutputProperties (org.talend.components.jira.tjiraoutput.TJiraOutputProperties)1