@Test
public void shouldGenerateViewDdlForSingleTable() throws Exception {

    loadVdbs();
    createDataservice(DATASERVICE_NAME);
    
    URI dataservicesUri = _uriBuilder.workspaceDataservicesUri();
    URI uri = UriBuilder.fromUri(dataservicesUri).path(V1Constants.SERVICE_VIEW_DDL_FOR_SINGLE_TABLE).build();
    // Required parms (dataserviceName, tablePath).
    // Valid entries - should generate DDL
    KomodoDataserviceUpdateAttributes updateAttr = new KomodoDataserviceUpdateAttributes();
    updateAttr.setDataserviceName(DATASERVICE_NAME);
    updateAttr.setTablePath("tko:komodo/tko:workspace/"+USER_NAME+"/Portfolio/PersonalValuations/Sheet1");
    ClientRequest request = request(uri, MediaType.APPLICATION_JSON_TYPE);
    addJsonConsumeContentType(request);
    addBody(request, updateAttr);
    ClientResponse<String> response = request.post(String.class);
    final String entity = response.getEntity();
    
    RestDataserviceViewInfo viewInfo = KomodoJsonMarshaller.unmarshall(entity, RestDataserviceViewInfo.class);
    assertEquals(RestDataserviceViewInfo.DDL_INFO, viewInfo.getInfoType());
    assertEquals("CREATE VIEW MyDataServiceView ( ROW_ID INTEGER, ACCOUNT_ID INTEGER, PRODUCT_TYPE STRING, PRODUCT_VALUE STRING, " +
                 "CONSTRAINT PK0 PRIMARY KEY (ROW_ID)) AS \nSELECT  ROW_ID, ACCOUNT_ID, PRODUCT_TYPE, PRODUCT_VALUE \nFROM Portfolio.Sheet1;", viewInfo.getViewDdl());
    assertEquals(false, viewInfo.isViewEditable());
}