freme-project / pipelines

Apache License 2.0
0 stars 0 forks source link

Test of pipeline 1 from the #45 with wrong e-Entity method failed #8

Closed m1ci closed 8 years ago

m1ci commented 8 years ago

e-Entity -> e-Link

curl -v -d @pipeline1.json -X POST -H "Content-Type: application/json" "http://localhost:8080/pipelining/chain"

pipeline1.json is the same e-Entity -> e-Link pipeline from the documentation with only changed the method for e-Entity from POST to POS

Results: returns Internal Server Error, it can be good if we get more understandable error, i.e. that the HTTP method is not supported or wrong.

ghsnd commented 8 years ago

I changed the errors to

{
  "exception": "eu.freme.broker.exception.NotAcceptableException",
  "path": "/pipelining/chain",
  "message": "Error detected in the JSON body contents: Request 1: HTTP Method not supported. Only GET and POST are supported.",
  "error": "Not Acceptable",
  "status": 406,
  "timestamp": 1440069489460
}

in the case of a wrong method, and

{
  "exception": "eu.freme.broker.exception.NotAcceptableException",
  "path": "/pipelining/chain",
  "message": "Error detected in the JSON body contents: Request 1: HTTP Method not supported. Only GET and POST are supported.",
  "error": "Not Acceptable",
  "status": 406,
  "timestamp": 1440069489460
}

when no endpoint is given. When an unexisting endpoind is given:

{
  "exception": "eu.freme.broker.exception.BadRequestException",
  "path": "/pipelining/chain",
  "message": "Request 1: java.net.UnknownHostException: ikdenknietdatditeenbestaandeurlis.be: unknown error",
  "error": "Bad Request",
  "status": 400,
  "timestamp": 1440072922421
}

Is this sufficient?

m1ci commented 8 years ago

Yes, great job!