5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-09 05:20:18 +08:00

SQOOP-2822: Sqoop2: RESTiliency: Provide tests for Link POST action

(Jarek Jarcec Cecho via Colin Ma)
This commit is contained in:
Colin Ma 2016-02-17 11:58:00 +08:00
parent 8133192015
commit 93e2dc376d

View File

@ -65,6 +65,26 @@ void validate() throws Exception {
assertServerException("Entity requested doesn't exist", "SERVER_0006");
assertContains("Invalid connector: i-dont-exists");
}}),
// Post
new TestDescription("Empty data", "v1/link", "POST", "", new Validator() {
@Override
void validate() throws Exception {
assertResponseCode(500);
assertServerException("Invalid JSON", "SERIALIZATION_002");
}}),
new TestDescription("Corrupted JSON", "v1/link", "POST", "{\"blah\" : {}", new Validator() {
@Override
void validate() throws Exception {
assertResponseCode(500);
assertServerException("Invalid JSON", "SERIALIZATION_002");
}}),
new TestDescription("Empty JSON", "v1/link", "POST", "{}", new Validator() {
@Override
void validate() throws Exception {
assertResponseCode(500);
assertServerException("Required key field is missing", "SERIALIZATION_003");
}}),
};
@DataProvider(name="link-rest-test", parallel=false)