@Test
public void testVantiqDateFormatting() throws VantiqSQLException {

    // Only run test with intended vantiq availability
    assumeTrue(testAuthToken != null && testVantiqServer != null);
    assumeTrue(testDBUsername != null && testDBPassword != null && testDBURL != null && jdbcDriverLoc != null);
    
    // Check that Source and Type do not already exist in namespace, and skip test if they do
    assumeFalse(checkSourceExists());
    assumeFalse(checkTypeExists());
            
    jdbc.setupJDBC(testDBURL, testDBUsername, testDBPassword, false, 0);
    
    // Setup a VANTIQ JDBC Source, and start running the core
    setupSource(createSourceDef(false, false));
    
    // Publish to the source in order to create a table
    Map<String,Object> create_params = new LinkedHashMap<String,Object>();
    create_params.put("query", CREATE_TABLE_DATETIME);
    vantiq.publish("sources", testSourceName, create_params);
    
    // Publish to the source in order to insert data into the table
    Map<String,Object> insert_params = new LinkedHashMap<String,Object>();
    insert_params.put("query", INSERT_VALUE_DATETIME);
    vantiq.publish("sources", testSourceName, insert_params);
    
    // Query the Source, and get the returned date
    Map<String,Object> params = new LinkedHashMap<String,Object>();
    params.put("query", QUERY_TABLE_DATETIME);
    VantiqResponse response = vantiq.query(testSourceName, params);
    JsonArray responseBody = (JsonArray) response.getBody();
    JsonObject responseMap = (JsonObject) responseBody.get(0);
    String timestamp = (String) responseMap.get("ts").getAsString();
    assertTrue("Expected " + FORMATTED_TIMESTAMP + ", but got " + timestamp,
            timestamp.equals(FORMATTED_TIMESTAMP));
    // Create a Type with DateTime property
    setupType();
    
    // Insert timestamp into Type
    Map<String,String> insertObj = new LinkedHashMap<String,String>();
    insertObj.put("timestamp", timestamp);
    vantiq.insert(testTypeName, insertObj);
    
    // Check that value is as expected
    response = vantiq.select(testTypeName, null, null, null);
    ArrayList typeResponseBody = (ArrayList) response.getBody();
    responseMap = (JsonObject) typeResponseBody.get(0);
    String vantiqTimestamp = (String) responseMap.get("timestamp").getAsString();
    
    // Check that the date was offset by adding 7 hours (since original date ends in 0700)
    assert vantiqTimestamp.equals(VANTIQ_FORMATTED_TIMESTAMP);
    
    // Delete the Type from VANTIQ
    deleteType();
    
    // Delete the Source from VANTIQ
    deleteSource();
}