import javax.ws.rs.client.Invocation.Builder;
import javax.ws.rs.client.InvocationCallback;
import javax.ws.rs.client.WebTarget;
+import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
/**
* Superclass for various HttpOperation tests.
- *
- * @param <Q> request type
*/
-public class BasicHttpOperation<Q> extends BasicOperation {
+public class BasicHttpOperation extends BasicOperation {
protected static final String MY_CLIENT = "my-client";
- protected static final String BASE_URI = "/base-uri";
- protected static final String PATH = "/my-path";
+ protected static final String BASE_URI = "http://my-host:6969/base-uri/";
+ protected static final String PATH = "my-path/";
@Captor
protected ArgumentCaptor<InvocationCallback<Response>> callbackCaptor;
@Captor
- protected ArgumentCaptor<Entity<Q>> requestCaptor;
+ protected ArgumentCaptor<Entity<String>> requestCaptor;
@Captor
protected ArgumentCaptor<Map<String, Object>> headerCaptor;
when(rawResponse.getStatus()).thenReturn(200);
when(webBuilder.async()).thenReturn(webAsync);
+ when(webBuilder.accept(any(MediaType.class))).thenReturn(webBuilder);
+ when(webBuilder.accept(any(String.class))).thenReturn(webBuilder);
when(webTarget.request()).thenReturn(webBuilder);
when(webTarget.path(any())).thenReturn(webTarget);