Merge branch 'feature/CTLE-433-cart-rover-now-extensiv-integration' into integration/sprint-26

This commit is contained in:
Tim Chamberlain
2023-06-06 11:14:58 -05:00
26 changed files with 695 additions and 128 deletions

View File

@ -84,6 +84,25 @@ class QJavalinImplementationTest extends QJavalinTestBase
/*******************************************************************************
** test getting serverInfo
**
*******************************************************************************/
@Test
public void test_serverInfo()
{
HttpResponse<String> response = Unirest.get(BASE_URL + "/serverInfo").asString();
assertEquals(200, response.getStatus());
JSONObject jsonObject = JsonUtils.toJSONObject(response.getBody());
assertTrue(jsonObject.has("startTimeMillis"));
assertTrue(jsonObject.has("startTimeHuman"));
assertTrue(jsonObject.has("uptimeHuman"));
assertTrue(jsonObject.has("uptimeMillis"));
}
/*******************************************************************************
** test the table-level meta-data endpoint
**

View File

@ -560,6 +560,34 @@ class QJavalinProcessHandlerTest extends QJavalinTestBase
/*******************************************************************************
** test calling download file endpoint
**
*******************************************************************************/
@Test
public void test_downloadFile()
{
HttpResponse<String> response = Unirest.get(BASE_URL + "/download/myTestFile.txt?filePath=/dev/null").asString();
assertEquals(200, response.getStatus());
assertEquals("OK", response.getStatusText());
}
/*******************************************************************************
** test calling download file with missing filePath
**
*******************************************************************************/
@Test
public void test_downloadFileMissingFilePath()
{
HttpResponse<String> response = Unirest.get(BASE_URL + "/download/myTestFile.txt").asString();
assertEquals(400, response.getStatus());
assertTrue(response.getBody().contains("A filePath was not provided"));
}
/*******************************************************************************
** test calling for possibleValue
**
@ -576,4 +604,4 @@ class QJavalinProcessHandlerTest extends QJavalinTestBase
assertEquals(1, jsonObject.getJSONArray("options").getJSONObject(0).getInt("id"));
assertEquals("Darin Kelkhoff (1)", jsonObject.getJSONArray("options").getJSONObject(0).getString("label"));
}
}
}