Update to clear internal caches between tests

This commit is contained in:
2023-06-28 11:17:38 -05:00
parent 360bf56481
commit be14afc11c
2 changed files with 25 additions and 1 deletions

View File

@ -69,6 +69,17 @@ public class QRecordApiAdapter
/*******************************************************************************
** Allow tests (that manipulate meta-data) to clear field caches.
*******************************************************************************/
public static void clearCaches()
{
fieldListCache.clear();
fieldMapCache.clear();
}
/*******************************************************************************
** Convert a QRecord to a map for the API
*******************************************************************************/
@ -327,5 +338,4 @@ public class QRecordApiAdapter
{
}
}

View File

@ -45,6 +45,8 @@ import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
import com.kingsrook.qqq.backend.core.model.metadata.tables.QTableMetaData;
import com.kingsrook.qqq.backend.core.utils.ValueUtils;
import org.json.JSONObject;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
@ -57,6 +59,18 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
class ApiImplementationTest extends BaseTest
{
/*******************************************************************************
**
*******************************************************************************/
@BeforeEach
@AfterEach
void beforeAndAfterEach()
{
QRecordApiAdapter.clearCaches();
}
/*******************************************************************************
**
*******************************************************************************/