mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 13:10:44 +00:00
Add static getTableName(Class) and instance.tableName() methods.
This commit is contained in:
@ -41,6 +41,7 @@ import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
@ -566,4 +567,22 @@ class QRecordEntityTest extends BaseTest
|
||||
assertEquals(0, order.getLineItems().size());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
*******************************************************************************/
|
||||
@Test
|
||||
void testTableName() throws QException
|
||||
{
|
||||
assertEquals(Item.TABLE_NAME, QRecordEntity.getTableName(Item.class));
|
||||
assertEquals(Item.TABLE_NAME, Item.getTableName(Item.class));
|
||||
assertEquals(Item.TABLE_NAME, new Item().tableName());
|
||||
|
||||
//////////////////////////////////
|
||||
// no TABLE_NAME in Order class //
|
||||
//////////////////////////////////
|
||||
assertThatThrownBy(() -> Order.getTableName(Order.class));
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user