Skip to content

Commit 70538f3

Browse files
author
Johannes Duesing
committed
Fixed tests related to deployment endpoint
1 parent 91ad148 commit 70538f3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/test/scala/de/upb/cs/swt/delphi/instanceregistry/connection/ServerTest.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -651,18 +651,18 @@ class ServerTest
651651
/** Minimal tests for docker operations **/
652652

653653
"fail to deploy if component type is invalid" in {
654-
Post("/instances/deploy?ComponentType=Car") ~> addAuthorization("Admin") ~> server.routes ~> check {
654+
Post("/instances/deploy", HttpEntity(ContentTypes.`application/json`, """{"ComponentType": "Car"}""")) ~> addAuthorization("Admin") ~> server.routes ~> check {
655655
status shouldEqual StatusCodes.BAD_REQUEST
656656
responseAs[String].toLowerCase should include("could not deserialize")
657657
}
658658

659659
//Wrong user type
660-
Post("/instances/deploy?ComponentType=Crawler") ~> addAuthorization("User") ~> server.routes ~> check {
660+
Post("/instances/deploy", HttpEntity(ContentTypes.`application/json`, """{"ComponentType": "Crawler"}""")) ~> addAuthorization("User") ~> server.routes ~> check {
661661
rejection.isInstanceOf[AuthenticationFailedRejection] shouldBe true
662662
}
663663

664664
//No authorization
665-
Post("/instances/deploy?ComponentType=Crawler") ~> server.routes ~> check {
665+
Post("/instances/deploy", HttpEntity(ContentTypes.`application/json`, """{"ComponentType": "Crawler"}""")) ~> server.routes ~> check {
666666
rejection.isInstanceOf[AuthenticationFailedRejection] shouldBe true
667667
}
668668
}

0 commit comments

Comments
 (0)