Search in sources :

Example 11 with JSONExportFormatter

use of com.yahoo.elide.async.export.formatter.JSONExportFormatter in project elide by yahoo.

the class JsonAPITableExportOperationTest method testProcessBadQuery.

@Test
public void testProcessBadQuery() throws IOException {
    dataPrep();
    TableExport queryObj = new TableExport();
    String query = "tableExport/^IllegalCharacter^";
    String id = "edc4a871-dff2-4054-804e-d80075cf827d";
    queryObj.setId(id);
    queryObj.setQuery(query);
    queryObj.setQueryType(QueryType.JSONAPI_V1_0);
    queryObj.setResultType(ResultType.CSV);
    JSONAPITableExportOperation jsonAPIOperation = new JSONAPITableExportOperation(new JSONExportFormatter(elide), asyncExecutorService, queryObj, requestScope, engine);
    TableExportResult queryResultObj = (TableExportResult) jsonAPIOperation.call();
    assertEquals(200, queryResultObj.getHttpStatus());
    assertEquals("Illegal character in path at index 12: tableExport/^IllegalCharacter^", queryResultObj.getMessage());
}
Also used : TableExport(com.yahoo.elide.async.models.TableExport) JSONExportFormatter(com.yahoo.elide.async.export.formatter.JSONExportFormatter) TableExportResult(com.yahoo.elide.async.models.TableExportResult) Test(org.junit.jupiter.api.Test)

Aggregations

JSONExportFormatter (com.yahoo.elide.async.export.formatter.JSONExportFormatter)11 TableExport (com.yahoo.elide.async.models.TableExport)10 TableExportResult (com.yahoo.elide.async.models.TableExportResult)10 Test (org.junit.jupiter.api.Test)10 CSVExportFormatter (com.yahoo.elide.async.export.formatter.CSVExportFormatter)1 TableExportFormatter (com.yahoo.elide.async.export.formatter.TableExportFormatter)1 AsyncQueryHook (com.yahoo.elide.async.hooks.AsyncQueryHook)1 TableExportHook (com.yahoo.elide.async.hooks.TableExportHook)1 ResultType (com.yahoo.elide.async.models.ResultType)1 AsyncExecutorService (com.yahoo.elide.async.service.AsyncExecutorService)1 EntityDictionary (com.yahoo.elide.core.dictionary.EntityDictionary)1 HashMap (java.util.HashMap)1 ExecutorService (java.util.concurrent.ExecutorService)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 Bean (org.springframework.context.annotation.Bean)1