-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #255 from neicnordic/refactor/query-execution-in-test
replace executeQuery() with executeUpdate() to stop throwing exceptio…
- Loading branch information
Showing
1 changed file
with
4 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,26 +63,15 @@ public static void setup() { | |
PreparedStatement file = connection.prepareStatement("SELECT local_ega.insert_file('body.enc','[email protected]');"); | ||
file.executeQuery(); | ||
PreparedStatement header = connection.prepareStatement("UPDATE local_ega.files SET header = '637279707434676801000000010000006c00000000000000aa7ad1bb4f93bf5e4fb3bc28a95bc4d80bf2fd8075e69eb2ee15e0a4f08f1d78ab98c8fd9b50e675f71311936e8d0c6f73538962b836355d5d4371a12eae46addb43518b5236fb9554249710a473026f34b264a61d2ba52ed11abc1efa1d3478fa40a710' WHERE id = 1;"); | ||
try { | ||
header.executeQuery(); | ||
} catch (Exception e) { | ||
log.info(e.getMessage()); | ||
} | ||
header.executeUpdate(); | ||
PreparedStatement finalize = connection.prepareStatement("UPDATE local_ega.files SET archive_path = 'test/body.enc', status = 'READY', stable_id = 'EGAF00000000014' WHERE id = 1;"); | ||
try { | ||
finalize.executeQuery(); | ||
} catch (Exception e) { | ||
log.info(e.getMessage()); | ||
} | ||
finalize.executeUpdate(); | ||
connection.close(); | ||
|
||
props.setProperty("user", "lega_out"); | ||
connection = DriverManager.getConnection(url, props); | ||
PreparedStatement dataset = connection.prepareStatement("INSERT INTO local_ega_ebi.filedataset(file_id, dataset_stable_id) values(1, 'EGAD00010000919');"); | ||
try { | ||
dataset.executeQuery(); | ||
} catch (Exception e) { | ||
log.info(e.getMessage()); | ||
} | ||
dataset.executeUpdate(); | ||
connection.close(); | ||
|
||
JSONArray tokens = Unirest.get("http://localhost:8000/tokens").asJson().getBody().getArray(); | ||
|