Search in sources :

Example 1 with MockJiraRestClient

use of org.apache.camel.component.jira.mocks.MockJiraRestClient in project camel by apache.

the class CommentConsumerTest method multiIssueTest.

@Test
public void multiIssueTest() throws Exception {
    MockEndpoint mockResultEndpoint = getMockEndpoint("mock:result");
    MockJiraRestClient jiraRestClient = factory.getClient();
    MockSearchRestClient searchRestClient = (MockSearchRestClient) jiraRestClient.getSearchClient();
    BasicIssue issue1 = searchRestClient.addIssue();
    Comment comment1 = searchRestClient.addCommentToIssue(issue1, "Comment added at " + new Date());
    BasicIssue issue2 = searchRestClient.addIssue();
    Comment comment2 = searchRestClient.addCommentToIssue(issue2, "Comment added at " + new Date());
    mockResultEndpoint.expectedBodiesReceivedInAnyOrder(comment1, comment2);
    mockResultEndpoint.assertIsSatisfied();
}
Also used : Comment(com.atlassian.jira.rest.client.domain.Comment) MockEndpoint(org.apache.camel.component.mock.MockEndpoint) BasicIssue(com.atlassian.jira.rest.client.domain.BasicIssue) MockSearchRestClient(org.apache.camel.component.jira.mocks.MockSearchRestClient) MockJiraRestClient(org.apache.camel.component.jira.mocks.MockJiraRestClient) Date(java.util.Date) Test(org.junit.Test)

Example 2 with MockJiraRestClient

use of org.apache.camel.component.jira.mocks.MockJiraRestClient in project camel by apache.

the class IssueConsumerTest method singleIssueTest.

@Test
public void singleIssueTest() throws Exception {
    MockEndpoint mockResultEndpoint = getMockEndpoint("mock:result");
    MockJiraRestClient client = factory.getClient();
    MockSearchRestClient restClient = (MockSearchRestClient) client.getSearchClient();
    BasicIssue issue1 = restClient.addIssue();
    mockResultEndpoint.expectedBodiesReceived(issue1);
    mockResultEndpoint.assertIsSatisfied();
}
Also used : MockEndpoint(org.apache.camel.component.mock.MockEndpoint) BasicIssue(com.atlassian.jira.rest.client.domain.BasicIssue) MockSearchRestClient(org.apache.camel.component.jira.mocks.MockSearchRestClient) MockJiraRestClient(org.apache.camel.component.jira.mocks.MockJiraRestClient) Test(org.junit.Test)

Example 3 with MockJiraRestClient

use of org.apache.camel.component.jira.mocks.MockJiraRestClient in project camel by apache.

the class IssueConsumerTest method multipleIssuesTest.

@Test
public void multipleIssuesTest() throws Exception {
    MockEndpoint mockResultEndpoint = getMockEndpoint("mock:result");
    MockJiraRestClient client = factory.getClient();
    MockSearchRestClient restClient = (MockSearchRestClient) client.getSearchClient();
    BasicIssue issue1 = restClient.addIssue();
    BasicIssue issue2 = restClient.addIssue();
    BasicIssue issue3 = restClient.addIssue();
    mockResultEndpoint.expectedBodiesReceived(issue3, issue2, issue1);
    mockResultEndpoint.assertIsSatisfied();
}
Also used : MockEndpoint(org.apache.camel.component.mock.MockEndpoint) BasicIssue(com.atlassian.jira.rest.client.domain.BasicIssue) MockSearchRestClient(org.apache.camel.component.jira.mocks.MockSearchRestClient) MockJiraRestClient(org.apache.camel.component.jira.mocks.MockJiraRestClient) Test(org.junit.Test)

Example 4 with MockJiraRestClient

use of org.apache.camel.component.jira.mocks.MockJiraRestClient in project camel by apache.

the class CommentConsumerTest method singleIssueTest.

@Test
public void singleIssueTest() throws Exception {
    MockEndpoint mockResultEndpoint = getMockEndpoint("mock:result");
    MockJiraRestClient jiraRestClient = factory.getClient();
    MockSearchRestClient searchRestClient = (MockSearchRestClient) jiraRestClient.getSearchClient();
    BasicIssue issue1 = searchRestClient.addIssue();
    String commentText = "Comment added at " + new Date();
    Comment comment1 = searchRestClient.addCommentToIssue(issue1, commentText);
    mockResultEndpoint.expectedBodiesReceived(comment1);
    mockResultEndpoint.assertIsSatisfied();
}
Also used : Comment(com.atlassian.jira.rest.client.domain.Comment) MockEndpoint(org.apache.camel.component.mock.MockEndpoint) BasicIssue(com.atlassian.jira.rest.client.domain.BasicIssue) MockSearchRestClient(org.apache.camel.component.jira.mocks.MockSearchRestClient) MockJiraRestClient(org.apache.camel.component.jira.mocks.MockJiraRestClient) Date(java.util.Date) Test(org.junit.Test)

Aggregations

BasicIssue (com.atlassian.jira.rest.client.domain.BasicIssue)4 MockJiraRestClient (org.apache.camel.component.jira.mocks.MockJiraRestClient)4 MockSearchRestClient (org.apache.camel.component.jira.mocks.MockSearchRestClient)4 MockEndpoint (org.apache.camel.component.mock.MockEndpoint)4 Test (org.junit.Test)4 Comment (com.atlassian.jira.rest.client.domain.Comment)2 Date (java.util.Date)2