mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 13:10:44 +00:00
Adding QJavalin Process Handler Test for possibleValues fields in process.
This commit is contained in:
@ -558,4 +558,22 @@ class QJavalinProcessHandlerTest extends QJavalinTestBase
|
|||||||
JSONArray jsonArray = JsonUtils.toJSONArray(response.getBody());
|
JSONArray jsonArray = JsonUtils.toJSONArray(response.getBody());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
** test calling for possibleValue
|
||||||
|
**
|
||||||
|
*******************************************************************************/
|
||||||
|
@Test
|
||||||
|
public void test_possibleValues()
|
||||||
|
{
|
||||||
|
HttpResponse<String> response = Unirest.get(BASE_URL + "/processes/greet/possibleValues/partnerPersonId").asString();
|
||||||
|
assertEquals(200, response.getStatus());
|
||||||
|
JSONObject jsonObject = JsonUtils.toJSONObject(response.getBody());
|
||||||
|
assertNotNull(jsonObject);
|
||||||
|
assertNotNull(jsonObject.getJSONArray("options"));
|
||||||
|
assertEquals(6, jsonObject.getJSONArray("options").length());
|
||||||
|
assertEquals(1, jsonObject.getJSONArray("options").getJSONObject(0).getInt("id"));
|
||||||
|
assertEquals("Darin Kelkhoff (1)", jsonObject.getJSONArray("options").getJSONObject(0).getString("label"));
|
||||||
|
}
|
||||||
}
|
}
|
@ -286,7 +286,8 @@ public class TestUtils
|
|||||||
.withRecordListMetaData(new QRecordListMetaData().withTableName(TABLE_NAME_PERSON))
|
.withRecordListMetaData(new QRecordListMetaData().withTableName(TABLE_NAME_PERSON))
|
||||||
.withFieldList(List.of(
|
.withFieldList(List.of(
|
||||||
new QFieldMetaData("greetingPrefix", QFieldType.STRING),
|
new QFieldMetaData("greetingPrefix", QFieldType.STRING),
|
||||||
new QFieldMetaData("greetingSuffix", QFieldType.STRING)
|
new QFieldMetaData("greetingSuffix", QFieldType.STRING),
|
||||||
|
new QFieldMetaData("partnerPersonId", QFieldType.INTEGER).withBackendName("partner_person_id").withPossibleValueSourceName(TABLE_NAME_PERSON)
|
||||||
)))
|
)))
|
||||||
.withOutputMetaData(new QFunctionOutputMetaData()
|
.withOutputMetaData(new QFunctionOutputMetaData()
|
||||||
.withRecordListMetaData(new QRecordListMetaData()
|
.withRecordListMetaData(new QRecordListMetaData()
|
||||||
|
Reference in New Issue
Block a user