mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-17 20:50:44 +00:00
more test coverage for javalin (for new anonymous inner TypeReference)
This commit is contained in:
@ -950,6 +950,28 @@ class QJavalinImplementationTest extends QJavalinTestBase
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
*******************************************************************************/
|
||||
@Test
|
||||
void testPossibleValueWithFilter()
|
||||
{
|
||||
HttpResponse<String> response = Unirest.post(BASE_URL + "/data/pet/possibleValues/ownerPersonId?searchTerm=")
|
||||
.field("values", """
|
||||
{"email":"tsamples@mmltholdings.com"}
|
||||
""")
|
||||
.asString();
|
||||
|
||||
assertEquals(200, response.getStatus());
|
||||
JSONObject jsonObject = JsonUtils.toJSONObject(response.getBody());
|
||||
assertNotNull(jsonObject);
|
||||
assertNotNull(jsonObject.getJSONArray("options"));
|
||||
assertEquals(1, jsonObject.getJSONArray("options").length());
|
||||
assertEquals("Tyler Samples (4)", jsonObject.getJSONArray("options").getJSONObject(0).getString("label"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
@ -316,7 +316,10 @@ public class TestUtils
|
||||
.withField(new QFieldMetaData("id", QFieldType.INTEGER))
|
||||
.withField(new QFieldMetaData("createDate", QFieldType.DATE_TIME).withBackendName("create_date"))
|
||||
.withField(new QFieldMetaData("modifyDate", QFieldType.DATE_TIME).withBackendName("modify_date"))
|
||||
.withField(new QFieldMetaData("ownerPersonId", QFieldType.INTEGER).withBackendName("owner_person_id"))
|
||||
.withField(new QFieldMetaData("ownerPersonId", QFieldType.INTEGER).withBackendName("owner_person_id")
|
||||
.withPossibleValueSourceName(TABLE_NAME_PERSON)
|
||||
.withPossibleValueSourceFilter(new QQueryFilter(new QFilterCriteria("email", QCriteriaOperator.EQUALS, "${input.email}")))
|
||||
)
|
||||
.withField(new QFieldMetaData("name", QFieldType.STRING).withBackendName("name"))
|
||||
.withField(new QFieldMetaData("species", QFieldType.STRING).withBackendName("species"));
|
||||
|
||||
|
Reference in New Issue
Block a user