@Test
public void testUploadFile() {

    SchemaParserDescriptor descriptor = createMockParserDescriptor();
    FormDataMultiPart form = new FormDataMultiPart();
    form.field("parser", descriptor, MediaType.APPLICATION_JSON_TYPE);
    form.field("fileName", "/Shared/marketing/scrap.txt");
    FormDataBodyPart fdp = new FormDataBodyPart("file",
                                                new ByteArrayInputStream("ABC".getBytes()), MediaType.APPLICATION_OCTET_STREAM_TYPE);
    form.bodyPart(fdp);
    Response response = target("/v1/schema-discovery/hive/sample-file").request(MediaType.APPLICATION_JSON_TYPE).post(Entity.entity(form, form.getMediaType()), Response.class);
    assertEquals(200, response.getStatus());
    assertNotNull("Expecting schema object", response.readEntity(DefaultHiveSchema.class));
}