src/test/java/org/embulk/input/jira/client/JiraClientTest.java in embulk-input-jira-0.2.7 vs src/test/java/org/embulk/input/jira/client/JiraClientTest.java in embulk-input-jira-0.2.8
- old
+ new
@@ -1,13 +1,13 @@
package org.embulk.input.jira.client;
import com.google.gson.JsonObject;
-import org.apache.http.HttpResponse;
import org.apache.http.StatusLine;
-import org.apache.http.client.HttpClient;
+import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
import org.embulk.EmbulkTestRuntime;
import org.embulk.config.ConfigException;
import org.embulk.config.ConfigSource;
import org.embulk.input.jira.Issue;
import org.embulk.input.jira.JiraInputPlugin.PluginTask;
@@ -32,20 +32,20 @@
@Rule
public EmbulkTestRuntime runtime = new EmbulkTestRuntime();
private JiraClient jiraClient;
private PluginTask task;
- private HttpClient client = Mockito.mock(HttpClient.class);
- private HttpResponse response = Mockito.mock(HttpResponse.class);
+ private CloseableHttpClient client = Mockito.mock(CloseableHttpClient.class);
+ private CloseableHttpResponse response = Mockito.mock(CloseableHttpResponse.class);
private StatusLine statusLine = Mockito.mock(StatusLine.class);
private JsonObject data;
@Before
public void setUp() throws IOException
{
if (jiraClient == null) {
jiraClient = Mockito.spy(new JiraClient());
- response = Mockito.mock(HttpResponse.class);
+ response = Mockito.mock(CloseableHttpResponse.class);
task = TestHelpers.config().loadConfig(PluginTask.class);
data = TestHelpers.getJsonFromFile("jira_client.json");
}
when(jiraClient.createHttpClient()).thenReturn(client);
when(client.execute(Mockito.any())).thenReturn(response);