Fix failing web action tests (#228)
* fix web action tests
* remove put from test description
* remove print statement
diff --git a/tests/src/test/scala/system/packages/KafkaFeedWebTests.scala b/tests/src/test/scala/system/packages/KafkaFeedWebTests.scala
index 5a426bb..421906b 100644
--- a/tests/src/test/scala/system/packages/KafkaFeedWebTests.scala
+++ b/tests/src/test/scala/system/packages/KafkaFeedWebTests.scala
@@ -53,12 +53,12 @@
"authKey" -> JsString("DoesNotWork")
)
- def makePutCallWithExpectedResult(params: JsObject, expectedResult: String, expectedCode: Int) = {
+ def makePostCallWithExpectedResult(params: JsObject, expectedResult: String, expectedCode: Int) = {
val response = RestAssured.given()
.contentType("application/json\r\n")
.config(RestAssured.config().sslConfig(new SSLConfig().relaxedHTTPSValidation()))
.body(params.toString())
- .put(webActionURL)
+ .post(webActionURL)
assert(response.statusCode() == expectedCode)
response.body.asString shouldBe expectedResult
}
@@ -81,23 +81,23 @@
it should "reject post of a trigger due to missing brokers argument" in {
val params = JsObject(completeParams.fields - "brokers")
- makePutCallWithExpectedResult(params, "You must supply a 'brokers' parameter.", 400)
+ makePostCallWithExpectedResult(params, "You must supply a 'brokers' parameter.", 400)
}
it should "reject post of a trigger due to missing topic argument" in {
val params = JsObject(completeParams.fields - "topic")
- makePutCallWithExpectedResult(params, "You must supply a 'topic' parameter.", 400)
+ makePostCallWithExpectedResult(params, "You must supply a 'topic' parameter.", 400)
}
it should "reject post of a trigger due to missing triggerName argument" in {
val params = JsObject(completeParams.fields - "triggerName")
- makePutCallWithExpectedResult(params, "You must supply a 'triggerName' parameter.", 400)
+ makePostCallWithExpectedResult(params, "You must supply a 'triggerName' parameter.", 400)
}
- it should "reject put of a trigger when authentication fails" in {
- makePutCallWithExpectedResult(completeParams, "You are not authorized for this trigger.", 401)
+ it should "reject post of a trigger when authentication fails" in {
+ makePostCallWithExpectedResult(completeParams, "You are not authorized for this trigger.", 401)
}
// it should "reject delete of a trigger that does not exist" in {
diff --git a/tests/src/test/scala/system/packages/MessageHubFeedWebTests.scala b/tests/src/test/scala/system/packages/MessageHubFeedWebTests.scala
index b5e2c81..4a3354a 100644
--- a/tests/src/test/scala/system/packages/MessageHubFeedWebTests.scala
+++ b/tests/src/test/scala/system/packages/MessageHubFeedWebTests.scala
@@ -53,12 +53,12 @@
"authKey" -> JsString("DoesNotWork")
)
- def makePutCallWithExpectedResult(params: JsObject, expectedResult: String, expectedCode: Int) = {
+ def makePostCallWithExpectedResult(params: JsObject, expectedResult: String, expectedCode: Int) = {
val response = RestAssured.given()
.contentType("application/json\r\n")
.config(RestAssured.config().sslConfig(new SSLConfig().relaxedHTTPSValidation()))
.body(params.toString())
- .put(webActionURL)
+ .post(webActionURL)
assert(response.statusCode() == expectedCode)
response.body.asString shouldBe expectedResult
}
@@ -81,35 +81,35 @@
it should "reject post of a trigger due to missing kafka_brokers_sasl argument" in {
val params = JsObject(completeParams.fields - "kafka_brokers_sasl")
- makePutCallWithExpectedResult(params, "You must supply a 'kafka_brokers_sasl' parameter.", 400)
+ makePostCallWithExpectedResult(params, "You must supply a 'kafka_brokers_sasl' parameter.", 400)
}
it should "reject post of a trigger due to missing topic argument" in {
val params = JsObject(completeParams.fields - "topic")
- makePutCallWithExpectedResult(params, "You must supply a 'topic' parameter.", 400)
+ makePostCallWithExpectedResult(params, "You must supply a 'topic' parameter.", 400)
}
it should "reject post of a trigger due to missing triggerName argument" in {
val params = JsObject(completeParams.fields - "triggerName")
- makePutCallWithExpectedResult(params, "You must supply a 'triggerName' parameter.", 400)
+ makePostCallWithExpectedResult(params, "You must supply a 'triggerName' parameter.", 400)
}
it should "reject post of a trigger due to missing user argument" in {
val params = JsObject(completeParams.fields - "user")
- makePutCallWithExpectedResult(params, "You must supply a 'user' parameter to authenticate with Message Hub.", 400)
+ makePostCallWithExpectedResult(params, "You must supply a 'user' parameter to authenticate with Message Hub.", 400)
}
it should "reject post of a trigger due to missing password argument" in {
val params = JsObject(completeParams.fields - "password")
- makePutCallWithExpectedResult(params, "You must supply a 'password' parameter to authenticate with Message Hub.", 400)
+ makePostCallWithExpectedResult(params, "You must supply a 'password' parameter to authenticate with Message Hub.", 400)
}
- it should "reject put of a trigger when authentication fails" in {
- makePutCallWithExpectedResult(completeParams, "You are not authorized for this trigger.", 401)
+ it should "reject post of a trigger when authentication fails" in {
+ makePostCallWithExpectedResult(completeParams, "You are not authorized for this trigger.", 401)
}
// it should "reject delete of a trigger that does not exist" in {