Changed service keepAlive from POST to PUT
[nonrtric.git] / policy-agent / src / test / java / org / oransc / policyagent / ApplicationTest.java
index 1784fea..9b73892 100644 (file)
@@ -542,7 +542,7 @@ public class ApplicationTest {
 
         // Keep alive
         url = "/services/keepalive?name=name";
-        ResponseEntity<String> entity = restClient().postForEntity(url, null).block();
+        ResponseEntity<String> entity = restClient().putForEntity(url).block();
         assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
 
         // DELETE service
@@ -552,11 +552,12 @@ public class ApplicationTest {
         assertThat(services.size()).isEqualTo(0);
 
         // Keep alive, no registerred service
-        testErrorCode(restClient().post("/services/keepalive?name=name", ""), HttpStatus.NOT_FOUND);
+        testErrorCode(restClient().put("/services/keepalive?name=name", ""), HttpStatus.NOT_FOUND);
 
-        // PUT servive with crap payload
+        // PUT servive with bad payload
         testErrorCode(restClient().put("/service", "crap"), HttpStatus.BAD_REQUEST);
         testErrorCode(restClient().put("/service", "{}"), HttpStatus.BAD_REQUEST);
+        testErrorCode(restClient().put("/service", createServiceJson("name", -123)), HttpStatus.BAD_REQUEST);
 
         // GET non existing servive
         testErrorCode(restClient().get("/services?name=XXX"), HttpStatus.NOT_FOUND);