@Test
public void toScriptWithParent() throws Exception {

    // Build the request
    final TransformRequest.Parent parent = new TransformRequest.Parent();
    parent.setScript("sqlContext.range(1,10)");
    parent.setTable("parent_table");
    final TransformRequest request = new TransformRequest();
    request.setParent(parent);
    request.setScript("parent.withColumn(functions.expr(\"id+1\")");
    // Test converting request to script
    final TransformService service = new TransformService(TransformScript.class, Mockito.mock(SparkScriptEngine.class), Mockito.mock(SparkContextService.class),
                                                          Mockito.mock(JobTrackerService.class), Mockito.mock(DataSetConverterService.class), Mockito.mock(KyloCatalogClientBuilder.class));
    InputStream inputStream = getClass().getResourceAsStream("transform-service-script2.scala");
    final String expected = IOUtils.toString(inputStream, "UTF-8");
    Assert.assertEquals(expected, service.toTransformScript(request));
}