mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 13:10:44 +00:00
Test fixes
This commit is contained in:
@ -81,12 +81,12 @@ class RecordAutomationStatusUpdaterTest extends BaseTest
|
|||||||
QTableMetaData tableWithInsertTrigger = new QTableMetaData()
|
QTableMetaData tableWithInsertTrigger = new QTableMetaData()
|
||||||
.withName("tableWithInsertTrigger");
|
.withName("tableWithInsertTrigger");
|
||||||
new InsertAction().execute(new InsertInput(TableTrigger.TABLE_NAME)
|
new InsertAction().execute(new InsertInput(TableTrigger.TABLE_NAME)
|
||||||
.withRecordEntity(new TableTrigger().withTableName(tableWithInsertTrigger.getName()).withPostInsert(true).withPostUpdate(false)));
|
.withRecordEntity(new TableTrigger().withTableName(tableWithInsertTrigger.getName()).withScriptId(-1).withPostInsert(true).withPostUpdate(false)));
|
||||||
|
|
||||||
QTableMetaData tableWithUpdateTrigger = new QTableMetaData()
|
QTableMetaData tableWithUpdateTrigger = new QTableMetaData()
|
||||||
.withName("tableWithUpdateTrigger");
|
.withName("tableWithUpdateTrigger");
|
||||||
new InsertAction().execute(new InsertInput(TableTrigger.TABLE_NAME)
|
new InsertAction().execute(new InsertInput(TableTrigger.TABLE_NAME)
|
||||||
.withRecordEntity(new TableTrigger().withTableName(tableWithUpdateTrigger.getName()).withPostInsert(false).withPostUpdate(true)));
|
.withRecordEntity(new TableTrigger().withTableName(tableWithUpdateTrigger.getName()).withScriptId(-1).withPostInsert(false).withPostUpdate(true)));
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// tests for going to PENDING_INSERT. //
|
// tests for going to PENDING_INSERT. //
|
||||||
|
@ -33,6 +33,7 @@ import com.kingsrook.qqq.backend.core.model.data.testentities.Item;
|
|||||||
import com.kingsrook.qqq.backend.core.model.data.testentities.ItemWithPrimitives;
|
import com.kingsrook.qqq.backend.core.model.data.testentities.ItemWithPrimitives;
|
||||||
import com.kingsrook.qqq.backend.core.model.data.testentities.LineItem;
|
import com.kingsrook.qqq.backend.core.model.data.testentities.LineItem;
|
||||||
import com.kingsrook.qqq.backend.core.model.data.testentities.Order;
|
import com.kingsrook.qqq.backend.core.model.data.testentities.Order;
|
||||||
|
import com.kingsrook.qqq.backend.core.model.data.testentities.OrderWithoutTableName;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.DisplayFormat;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.DisplayFormat;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldType;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldType;
|
||||||
@ -582,7 +583,7 @@ class QRecordEntityTest extends BaseTest
|
|||||||
//////////////////////////////////
|
//////////////////////////////////
|
||||||
// no TABLE_NAME in Order class //
|
// no TABLE_NAME in Order class //
|
||||||
//////////////////////////////////
|
//////////////////////////////////
|
||||||
assertThatThrownBy(() -> Order.getTableName(Order.class));
|
assertThatThrownBy(() -> OrderWithoutTableName.getTableName(OrderWithoutTableName.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -32,6 +32,8 @@ import com.kingsrook.qqq.backend.core.model.data.QRecordEntity;
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
public class ItemWithPrimitives extends QRecordEntity
|
public class ItemWithPrimitives extends QRecordEntity
|
||||||
{
|
{
|
||||||
|
public static final String TABLE_NAME = "item";
|
||||||
|
|
||||||
@QField()
|
@QField()
|
||||||
private String sku;
|
private String sku;
|
||||||
|
|
||||||
|
@ -31,6 +31,8 @@ import com.kingsrook.qqq.backend.core.model.data.QRecordEntity;
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
public class LineItem extends QRecordEntity
|
public class LineItem extends QRecordEntity
|
||||||
{
|
{
|
||||||
|
public static final String TABLE_NAME = "lineItem";
|
||||||
|
|
||||||
@QField()
|
@QField()
|
||||||
private String sku;
|
private String sku;
|
||||||
|
|
||||||
|
@ -33,6 +33,8 @@ import com.kingsrook.qqq.backend.core.model.data.QRecordEntity;
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
public class Order extends QRecordEntity
|
public class Order extends QRecordEntity
|
||||||
{
|
{
|
||||||
|
public static final String TABLE_NAME = "order";
|
||||||
|
|
||||||
@QField()
|
@QField()
|
||||||
private String orderNo;
|
private String orderNo;
|
||||||
|
|
||||||
|
@ -0,0 +1,104 @@
|
|||||||
|
/*
|
||||||
|
* QQQ - Low-code Application Framework for Engineers.
|
||||||
|
* Copyright (C) 2021-2022. Kingsrook, LLC
|
||||||
|
* 651 N Broad St Ste 205 # 6917 | Middletown DE 19709 | United States
|
||||||
|
* contact@kingsrook.com
|
||||||
|
* https://github.com/Kingsrook/
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as
|
||||||
|
* published by the Free Software Foundation, either version 3 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.kingsrook.qqq.backend.core.model.data.testentities;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.kingsrook.qqq.backend.core.model.data.QAssociation;
|
||||||
|
import com.kingsrook.qqq.backend.core.model.data.QField;
|
||||||
|
import com.kingsrook.qqq.backend.core.model.data.QRecordEntity;
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
** Sample of an entity that is missing a TABLE_NAME field
|
||||||
|
*******************************************************************************/
|
||||||
|
public class OrderWithoutTableName extends QRecordEntity
|
||||||
|
{
|
||||||
|
@QField()
|
||||||
|
private String orderNo;
|
||||||
|
|
||||||
|
@QAssociation(name = "lineItems")
|
||||||
|
private List<LineItem> lineItems;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
** Getter for orderNo
|
||||||
|
*******************************************************************************/
|
||||||
|
public String getOrderNo()
|
||||||
|
{
|
||||||
|
return (this.orderNo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
** Setter for orderNo
|
||||||
|
*******************************************************************************/
|
||||||
|
public void setOrderNo(String orderNo)
|
||||||
|
{
|
||||||
|
this.orderNo = orderNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
** Fluent setter for orderNo
|
||||||
|
*******************************************************************************/
|
||||||
|
public OrderWithoutTableName withOrderNo(String orderNo)
|
||||||
|
{
|
||||||
|
this.orderNo = orderNo;
|
||||||
|
return (this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
** Getter for lineItems
|
||||||
|
*******************************************************************************/
|
||||||
|
public List<LineItem> getLineItems()
|
||||||
|
{
|
||||||
|
return (this.lineItems);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
** Setter for lineItems
|
||||||
|
*******************************************************************************/
|
||||||
|
public void setLineItems(List<LineItem> lineItems)
|
||||||
|
{
|
||||||
|
this.lineItems = lineItems;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
** Fluent setter for lineItems
|
||||||
|
*******************************************************************************/
|
||||||
|
public OrderWithoutTableName withLineItems(List<LineItem> lineItems)
|
||||||
|
{
|
||||||
|
this.lineItems = lineItems;
|
||||||
|
return (this);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -33,6 +33,8 @@ import com.kingsrook.qqq.backend.core.model.data.QRecordEntity;
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
public class Shape extends QRecordEntity
|
public class Shape extends QRecordEntity
|
||||||
{
|
{
|
||||||
|
public static final String TABLE_NAME = "shape";
|
||||||
|
|
||||||
@QField()
|
@QField()
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user