CE-781 Updates for compatibility with corresponding changes, refactoring, in backend-core

This commit is contained in:
2024-01-08 16:40:56 -06:00
parent 56a2949911
commit 68911190fa
6 changed files with 49 additions and 152 deletions

View File

@ -65,7 +65,7 @@ public class RDBMSInsertActionTest extends RDBMSActionTest
{
InsertInput insertInput = initInsertRequest();
insertInput.setRecords(null);
InsertOutput insertOutput = new RDBMSInsertAction().execute(insertInput);
InsertOutput insertOutput = new InsertAction().execute(insertInput);
assertEquals(0, insertOutput.getRecords().size());
}
@ -79,7 +79,7 @@ public class RDBMSInsertActionTest extends RDBMSActionTest
{
InsertInput insertInput = initInsertRequest();
insertInput.setRecords(Collections.emptyList());
InsertOutput insertOutput = new RDBMSInsertAction().execute(insertInput);
InsertOutput insertOutput = new InsertAction().execute(insertInput);
assertEquals(0, insertOutput.getRecords().size());
}
@ -98,7 +98,7 @@ public class RDBMSInsertActionTest extends RDBMSActionTest
.withValue("email", "jamestk@starfleet.net")
.withValue("birthDate", "2210-05-20");
insertInput.setRecords(List.of(record));
InsertOutput insertOutput = new RDBMSInsertAction().execute(insertInput);
InsertOutput insertOutput = new InsertAction().execute(insertInput);
assertEquals(1, insertOutput.getRecords().size(), "Should return 1 row");
assertNotNull(insertOutput.getRecords().get(0).getValue("id"), "Should have an id in the row");
// todo - add errors to QRecord? assertTrue(insertResult.getRecords().stream().noneMatch(qrs -> CollectionUtils.nullSafeHasContents(qrs.getErrors())), "There should be no errors");
@ -132,7 +132,7 @@ public class RDBMSInsertActionTest extends RDBMSActionTest
.withValue("email", "doctor@starfleet.net")
.withValue("birthDate", "2320-06-26");
insertInput.setRecords(List.of(record1, record2, record3));
InsertOutput insertOutput = new RDBMSInsertAction().execute(insertInput);
InsertOutput insertOutput = new InsertAction().execute(insertInput);
assertEquals(3, insertOutput.getRecords().size(), "Should return right # of rows");
assertEquals(6, insertOutput.getRecords().get(0).getValue("id"), "Should have next id in the row");
assertEquals(7, insertOutput.getRecords().get(1).getValue("id"), "Should have next id in the row");

View File

@ -635,7 +635,7 @@ public class RDBMSQueryActionTest extends RDBMSActionTest
insertInput.setTableName(TestUtils.TABLE_NAME_PERSON);
InsertAction insertAction = new InsertAction();
QBackendTransaction transaction = insertAction.openTransaction(insertInput);
QBackendTransaction transaction = QBackendTransaction.openFor(insertInput);
insertInput.setTransaction(transaction);
insertInput.setRecords(List.of(