more test coverage for javalin (for new anonymous inner TypeReference)

This commit is contained in:
2024-07-19 15:50:45 -05:00
parent be0e1f9c0b
commit 028751e23a
2 changed files with 26 additions and 1 deletions

View File

@ -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"));
}
/*******************************************************************************
**
*******************************************************************************/

View File

@ -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"));