@Test
public void createWithMissingParentTable() {

    // Create transform request
    TransformRequest request = new TransformRequest();
    request.setScript("parent");
    TransformRequest.Parent parent = new TransformRequest.Parent();
    parent.setScript("sqlContext.sql(\"SELECT * FROM invalid\")");
    request.setParent(parent);
    // Test missing parent table
    SparkShellTransformController controller = new SparkShellTransformController();
    Response response = controller.create(request);
    Assert.assertEquals(Response.Status.BAD_REQUEST, response.getStatusInfo());
    TransformResponse entity = (TransformResponse) response.getEntity();
    Assert.assertEquals("The parent must include the table containing the results.", entity.getMessage());
    Assert.assertEquals(TransformResponse.Status.ERROR, entity.getStatus());
}