Commit 074211db by Suma Shivaprasad

BUG_36056 - Fixed all issues in ITs

parent bbc46662
......@@ -52,29 +52,31 @@ public class MetadataServiceClient {
service = client.resource(UriBuilder.fromUri(baseUrl).build());
}
private static final String BASE_URI = "api/metadata/";
static enum API {
//Type operations
CREATE_TYPE("api/metadata/types/submit", HttpMethod.POST),
GET_TYPE("api/metadata/types/definition", HttpMethod.GET),
LIST_TYPES("api/metadata/types/list", HttpMethod.GET),
LIST_TRAIT_TYPES("api/metadata/types/traits/list", HttpMethod.GET),
CREATE_TYPE(BASE_URI + "types", HttpMethod.POST),
GET_TYPE(BASE_URI + "types", HttpMethod.GET),
LIST_TYPES(BASE_URI + "types", HttpMethod.GET),
LIST_TRAIT_TYPES(BASE_URI + "types?type=trait", HttpMethod.GET),
//Entity operations
CREATE_ENTITY("api/metadata/entities/submit", HttpMethod.POST),
GET_ENTITY("api/metadata/entities/definition", HttpMethod.GET),
UPDATE_ENTITY("api/metadata/entities/update", HttpMethod.PUT),
LIST_ENTITY("api/metadata/entities/list", HttpMethod.GET),
CREATE_ENTITY(BASE_URI + "entities", HttpMethod.POST),
GET_ENTITY(BASE_URI + "entities", HttpMethod.GET),
UPDATE_ENTITY(BASE_URI + "entities", HttpMethod.PUT),
LIST_ENTITY(BASE_URI + "entities", HttpMethod.GET),
//Trait operations
ADD_TRAITS("api/metadata/traits/add", HttpMethod.POST),
DELETE_TRAITS("api/metadata/traits/delete", HttpMethod.PUT),
LIST_TRAITS("api/metadata/traits/list", HttpMethod.GET),
ADD_TRAITS(BASE_URI + "traits", HttpMethod.POST),
DELETE_TRAITS(BASE_URI + "traits", HttpMethod.DELETE),
LIST_TRAITS(BASE_URI + "traits", HttpMethod.GET),
//Search operations
SEARCH("api/metadata/discovery/search", HttpMethod.GET),
SEARCH_DSL("api/metadata/discovery/search/dsl", HttpMethod.GET),
SEARCH_GREMLIN("api/metadata/discovery/search/gremlin", HttpMethod.GET),
SEARCH_FULL_TEXT("api/metadata/discovery/search/fulltext", HttpMethod.GET);
SEARCH(BASE_URI + "discovery/search", HttpMethod.GET),
SEARCH_DSL(BASE_URI + "discovery/search/dsl", HttpMethod.GET),
SEARCH_GREMLIN(BASE_URI + "discovery/search/gremlin", HttpMethod.GET),
SEARCH_FULL_TEXT(BASE_URI + "discovery/search/fulltext", HttpMethod.GET);
private final String method;
private final String path;
......
......@@ -150,7 +150,7 @@ public class EntityResource {
*/
@GET
@Produces(MediaType.APPLICATION_JSON)
public Response getEntityList(@QueryParam("type") String entityType,
public Response getEntityListByType(@QueryParam("type") String entityType,
@DefaultValue("0") @QueryParam("offset") Integer offset,
@QueryParam("numResults") Integer resultsPerPage) {
Preconditions.checkNotNull(entityType, "Entity type cannot be null");
......
......@@ -219,7 +219,8 @@ public class EntityJerseyResourceIT extends BaseResourceIT {
@Test
public void testGetEntityListForBadEntityType() throws Exception {
ClientResponse clientResponse = service
.path("api/metadata/entities/blah")
.path("api/metadata/entities")
.queryParam("type", "blah")
.accept(MediaType.APPLICATION_JSON)
.type(MediaType.APPLICATION_JSON)
.method(HttpMethod.GET, ClientResponse.class);
......@@ -235,7 +236,8 @@ public class EntityJerseyResourceIT extends BaseResourceIT {
addNewType();
ClientResponse clientResponse = service
.path("api/metadata/entities/test")
.path("api/metadata/entities")
.queryParam("type", "test")
.accept(MediaType.APPLICATION_JSON)
.type(MediaType.APPLICATION_JSON)
.method(HttpMethod.GET, ClientResponse.class);
......
......@@ -53,6 +53,8 @@ import java.util.List;
*/
public class HiveLineageJerseyResourceIT extends BaseResourceIT {
private static final String BASE_URI = "api/metadata/lineage/hive/table/";
@BeforeClass
public void setUp() throws Exception {
super.setUp();
......@@ -64,8 +66,9 @@ public class HiveLineageJerseyResourceIT extends BaseResourceIT {
@Test
public void testInputs() throws Exception {
WebResource resource = service
.path("api/metadata/lineage/hive/inputs")
.path("sales_fact_monthly_mv");
.path(BASE_URI)
.path("sales_fact_monthly_mv")
.path("inputs");
ClientResponse clientResponse = resource
.accept(MediaType.APPLICATION_JSON)
......@@ -94,8 +97,9 @@ public class HiveLineageJerseyResourceIT extends BaseResourceIT {
@Test
public void testOutputs() throws Exception {
WebResource resource = service
.path("api/metadata/lineage/hive/outputs")
.path("sales_fact");
.path(BASE_URI)
.path("sales_fact")
.path("outputs");
ClientResponse clientResponse = resource
.accept(MediaType.APPLICATION_JSON)
......@@ -124,8 +128,9 @@ public class HiveLineageJerseyResourceIT extends BaseResourceIT {
@Test
public void testSchema() throws Exception {
WebResource resource = service
.path("api/metadata/lineage/hive/schema")
.path("sales_fact");
.path(BASE_URI)
.path("sales_fact")
.path("schema");
ClientResponse clientResponse = resource
.accept(MediaType.APPLICATION_JSON)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment