mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 13:10:44 +00:00
Merge pull request #14 from Kingsrook/dependabot/maven/com.h2database-h2-2.1.210
Bump h2 from 1.4.197 to 2.1.210
This commit is contained in:
2
pom.xml
2
pom.xml
@ -69,7 +69,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.h2database</groupId>
|
<groupId>com.h2database</groupId>
|
||||||
<artifactId>h2</artifactId>
|
<artifactId>h2</artifactId>
|
||||||
<version>1.4.197</version>
|
<version>2.1.210</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
@ -246,7 +246,8 @@ class QPicoCliImplementationTest
|
|||||||
{
|
{
|
||||||
TestOutput testOutput = testCli("person", "insert",
|
TestOutput testOutput = testCli("person", "insert",
|
||||||
"--field-firstName=Lucy",
|
"--field-firstName=Lucy",
|
||||||
"--field-lastName=Lu");
|
"--field-lastName=Lu",
|
||||||
|
"--field-email=lucy@kingsrook.com");
|
||||||
JSONObject insertResult = JsonUtils.toJSONObject(testOutput.getOutput());
|
JSONObject insertResult = JsonUtils.toJSONObject(testOutput.getOutput());
|
||||||
assertNotNull(insertResult);
|
assertNotNull(insertResult);
|
||||||
assertEquals(1, insertResult.getJSONArray("records").length());
|
assertEquals(1, insertResult.getJSONArray("records").length());
|
||||||
@ -263,11 +264,11 @@ class QPicoCliImplementationTest
|
|||||||
public void test_tableInsertJsonObjectArgumentWithMapping()
|
public void test_tableInsertJsonObjectArgumentWithMapping()
|
||||||
{
|
{
|
||||||
String mapping = """
|
String mapping = """
|
||||||
--mapping={"firstName":"first","lastName":"ln"}
|
--mapping={"firstName":"first","lastName":"ln","email":"email"}
|
||||||
""";
|
""";
|
||||||
|
|
||||||
String jsonBody = """
|
String jsonBody = """
|
||||||
--jsonBody={"first":"Chester","ln":"Cheese"}
|
--jsonBody={"first":"Chester","ln":"Cheese","email":"chester@kingsrook.com"}
|
||||||
""";
|
""";
|
||||||
|
|
||||||
TestOutput testOutput = testCli("person", "insert", mapping, jsonBody);
|
TestOutput testOutput = testCli("person", "insert", mapping, jsonBody);
|
||||||
@ -277,6 +278,7 @@ class QPicoCliImplementationTest
|
|||||||
assertEquals(6, insertResult.getJSONArray("records").getJSONObject(0).getJSONObject("values").getInt("id"));
|
assertEquals(6, insertResult.getJSONArray("records").getJSONObject(0).getJSONObject("values").getInt("id"));
|
||||||
assertEquals("Chester", insertResult.getJSONArray("records").getJSONObject(0).getJSONObject("values").getString("firstName"));
|
assertEquals("Chester", insertResult.getJSONArray("records").getJSONObject(0).getJSONObject("values").getString("firstName"));
|
||||||
assertEquals("Cheese", insertResult.getJSONArray("records").getJSONObject(0).getJSONObject("values").getString("lastName"));
|
assertEquals("Cheese", insertResult.getJSONArray("records").getJSONObject(0).getJSONObject("values").getString("lastName"));
|
||||||
|
assertEquals("chester@kingsrook.com", insertResult.getJSONArray("records").getJSONObject(0).getJSONObject("values").getString("email"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -289,11 +291,14 @@ class QPicoCliImplementationTest
|
|||||||
public void test_tableInsertJsonArrayFileWithMapping() throws IOException
|
public void test_tableInsertJsonArrayFileWithMapping() throws IOException
|
||||||
{
|
{
|
||||||
String mapping = """
|
String mapping = """
|
||||||
--mapping={"firstName":"first","lastName":"ln"}
|
--mapping={"firstName":"first","lastName":"ln","email":"email"}
|
||||||
""";
|
""";
|
||||||
|
|
||||||
String jsonContents = """
|
String jsonContents = """
|
||||||
[{"first":"Charlie","ln":"Bear"},{"first":"Coco","ln":"Bean"}]
|
[
|
||||||
|
{"first":"Charlie","ln":"Bear","email":"charlie-bear@kingsrook.com"},
|
||||||
|
{"first":"Coco","ln":"Bean","email":"coco-bean@kingsrook.com"}
|
||||||
|
]
|
||||||
""";
|
""";
|
||||||
|
|
||||||
File file = new File("/tmp/" + UUID.randomUUID() + ".json");
|
File file = new File("/tmp/" + UUID.randomUUID() + ".json");
|
||||||
@ -309,8 +314,10 @@ class QPicoCliImplementationTest
|
|||||||
assertEquals(7, insertResult.getJSONArray("records").getJSONObject(1).getJSONObject("values").getInt("id"));
|
assertEquals(7, insertResult.getJSONArray("records").getJSONObject(1).getJSONObject("values").getInt("id"));
|
||||||
assertEquals("Charlie", records.getJSONObject(0).getJSONObject("values").getString("firstName"));
|
assertEquals("Charlie", records.getJSONObject(0).getJSONObject("values").getString("firstName"));
|
||||||
assertEquals("Bear", records.getJSONObject(0).getJSONObject("values").getString("lastName"));
|
assertEquals("Bear", records.getJSONObject(0).getJSONObject("values").getString("lastName"));
|
||||||
|
assertEquals("charlie-bear@kingsrook.com", records.getJSONObject(0).getJSONObject("values").getString("email"));
|
||||||
assertEquals("Coco", records.getJSONObject(1).getJSONObject("values").getString("firstName"));
|
assertEquals("Coco", records.getJSONObject(1).getJSONObject("values").getString("firstName"));
|
||||||
assertEquals("Bean", records.getJSONObject(1).getJSONObject("values").getString("lastName"));
|
assertEquals("Bean", records.getJSONObject(1).getJSONObject("values").getString("lastName"));
|
||||||
|
assertEquals("coco-bean@kingsrook.com", records.getJSONObject(1).getJSONObject("values").getString("email"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -323,12 +330,12 @@ class QPicoCliImplementationTest
|
|||||||
public void test_tableInsertCsvFileWithIndexMapping() throws IOException
|
public void test_tableInsertCsvFileWithIndexMapping() throws IOException
|
||||||
{
|
{
|
||||||
String mapping = """
|
String mapping = """
|
||||||
--mapping={"firstName":1,"lastName":3}
|
--mapping={"firstName":1,"lastName":3,"email":5}
|
||||||
""";
|
""";
|
||||||
|
|
||||||
String csvContents = """
|
String csvContents = """
|
||||||
"Louis","P","Willikers",1024,
|
"Louis","P","Willikers",1024,"louis@kingsrook.com",
|
||||||
"Nestle","G","Crunch",1701,
|
"Nestle","G","Crunch",1701,"nestle@kingsrook.com",
|
||||||
|
|
||||||
""";
|
""";
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
DROP TABLE IF EXISTS person;
|
DROP TABLE IF EXISTS person;
|
||||||
CREATE TABLE person
|
CREATE TABLE person
|
||||||
(
|
(
|
||||||
id SERIAL,
|
id INT AUTO_INCREMENT,
|
||||||
create_date TIMESTAMP DEFAULT now(),
|
create_date TIMESTAMP DEFAULT now(),
|
||||||
modify_date TIMESTAMP DEFAULT now(),
|
modify_date TIMESTAMP DEFAULT now(),
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user