import javax.ws.rs.core.*;
import java.io.UnsupportedEncodingException;
import java.net.URI;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
import static org.mockito.Matchers.anyObject;
import static org.mockito.Mockito.doReturn;
protected static final MediaType APPLICATION_JSON = MediaType.valueOf("application/json");
private static final String EMPTY = "";
+ private final QueryStyle queryStyle;
protected HttpHeaders httpHeaders;
protected UriInfo uriInfo;
protected List<String> aaiRequestContextList;
protected List<MediaType> outputMediaTypes;
+ public HttpTestUtil(QueryStyle qs) {
+ this.queryStyle = qs;
+ }
+
public void init(){
httpHeaders = Mockito.mock(HttpHeaders.class);
if(arr != null && arr.length > 1){
if(arr[0].matches("^v\\d+")){
- version = Version.valueOf(arr[0]);
+ version = Version.getVersion(arr[0]);
uri = uri.replaceAll("^v\\d+", "");
}
}
Mockito.when(uriInfo.getPath()).thenReturn(uri);
DBConnectionType type = DBConnectionType.REALTIME;
- HttpEntry httpEntry = new HttpEntry(version, ModelType.MOXY, QueryStyle.TRAVERSAL, type);
+ HttpEntry httpEntry = new HttpEntry(version, ModelType.MOXY, queryStyle, type);
Loader loader = httpEntry.getLoader();
dbEngine = httpEntry.getDbEngine();
if(arr != null && arr.length > 1){
if(arr[0].matches("^v\\d+")){
- version = Version.valueOf(arr[0]);
+ version = Version.getVersion(arr[0]);
uri = uri.replaceAll("^v\\d+", "");
}
}
}
DBConnectionType type = DBConnectionType.REALTIME;
- HttpEntry httpEntry = new HttpEntry(version, ModelType.MOXY, QueryStyle.TRAVERSAL, type);
+ HttpEntry httpEntry = new HttpEntry(version, ModelType.MOXY, queryStyle, type);
Loader loader = httpEntry.getLoader();
dbEngine = httpEntry.getDbEngine();
if(arr != null && arr.length > 1){
if(arr[0].matches("^v\\d+")){
- version = Version.valueOf(arr[0]);
+ version = Version.getVersion(arr[0]);
if(!uri.contains("relationship-list/relationship")){
uri = uri.replaceAll("^v\\d+", "");
}
Mockito.when(uriInfo.getPath()).thenReturn(uri);
DBConnectionType type = DBConnectionType.REALTIME;
- HttpEntry httpEntry = new HttpEntry(version, ModelType.MOXY, QueryStyle.TRAVERSAL, type);
+ HttpEntry httpEntry = new HttpEntry(version, ModelType.MOXY, queryStyle, type);
Loader loader = httpEntry.getLoader();
dbEngine = httpEntry.getDbEngine();