-
-
Notifications
You must be signed in to change notification settings - Fork 543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improves Java REST tests: unique Strings, negative assertions #49
Improves Java REST tests: unique Strings, negative assertions #49
Conversation
After discussing with @marcospereira, the behavior of Play is correct and the failing test here is wrong: the test expects Note that in play-scala-rest-example there's a similar test which does the exact same assertion and passes the test. The reason is that play-scala-rest-example sneakily includes support for trailing slashes but that's not a vanilla Play feature. |
Co-Authored-By: Dale Wijnand <344610+dwijnand@users.noreply.github.com>
886c1b0
to
7d73ea7
Compare
private Optional<PostResource> findPostByTitle(JsonNode listOfPosts, String postTitle) { | ||
Iterator<JsonNode> elements = listOfPosts.elements(); | ||
// spliterator dance to build a Stream from an Iterator | ||
return StreamSupport.stream( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh... this is API is so nice. /s
@@ -1,5 +1,8 @@ | |||
#!/usr/bin/env bash | |||
|
|||
set -e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
…2.6.x Upgrade branch 2.6.x using TemplateControl
…2.6.x Upgrade branch 2.6.x using TemplateControl
…o 2.6.x * play-java-fileupload-example/2.6.x: (47 commits) Nest play-java-fileupload-example Updated with template-control on 2019-02-13T20:25:39.476Z (playframework#76) Upgrade branch 2.6.x using TemplateControl (playframework#74) Upgrade branch 2.6.x using TemplateControl (playframework#73) Upgrade branch 2.6.x using TemplateControl (playframework#72) Updated with template-control on 2019-01-08T14:44:42.021Z (playframework#70) Updated with template-control on 2019-01-04T17:13:23.621Z (playframework#65) Upgrade branch 2.6.x using TemplateControl (playframework#64) Upgrade branch 2.6.x using TemplateControl (playframework#61) Updated with template-control on 2018-09-11T20:14:49.858Z (playframework#60) Updated with template-control on 2018-08-20T20:37:13.644Z (playframework#59) Updated with template-control on 2018-07-19T01:58:54.727Z (playframework#57) Updated with template-control on 2018-07-16T18:38:45.481Z (playframework#56) Upgrade branch 2.6.x using TemplateControl (playframework#55) Updated with template-control on 2018-05-27T23:54:09.370Z (playframework#54) Updated with template-control on 2018-04-06T19:34:57.877Z (playframework#52) Add explicit note on upload limit (playframework#51) Updated with template-control on 2018-03-02T18:56:28.047Z (playframework#49) Upgrade branch 2.6.x using TemplateControl (playframework#48) Fix cross build to sbt 1.1.0 (playframework#47) ...
…2.6.x * play-java-rest-api-example/2.6.x: (61 commits) Nest play-java-rest-api-example Updated with template-control on 2019-02-13T20:25:39.721Z (playframework#81) Upgrade branch 2.6.x using TemplateControl (playframework#79) Updated with template-control on 2019-01-17T15:10:58.259Z /.mergify.yml: wrote /.mergify.yml Updated with template-control on 2019-01-16T12:08:46.124Z /LICENSE: wrote /LICENSE /NOTICE: wrote /NOTICE /.mergify.yml: wrote /.mergify.yml **build.sbt: scalaVersion := "2.12.8" **build.gradle: playTest "io.gatling.highcharts:gatling-charts-highcharts:$gatlingVersion" **build.gradle: playTest "io.gatling:gatling-test-framework:$gatlingVersion" Upgrade branch 2.6.x using TemplateControl (playframework#74) Upgrade branch 2.6.x using TemplateControl (playframework#65) fixing wrong template-ctrl replacement Updated with template-control on 2018-11-29T16:03:57.787Z /.mergify.yml: wrote /.mergify.yml **build.sbt: scalaVersion := "2.12.7" **/build.properties: sbt.version=1.2.6 removed jdk 9 and 10 removed misterious GatlingSpec fixed build.sbt Updated with template-control on 2018-11-16T14:25:15.563Z **build.sbt: scalaVersion := "2.12.6" **/plugins.sbt: addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.6.20") **build.gradle: def playVersion = "2.6.20" Upgrade branch 2.6.x using TemplateControl (playframework#55) Upgrade branch 2.6.x using TemplateControl (playframework#54) Upgrade branch 2.6.x using TemplateControl (playframework#51) Upgrade branch 2.6.x using TemplateControl (playframework#50) Upgrade branch 2.6.x using TemplateControl (playframework#49) Correct scalaVersion setting Revert gatling version changes ...
… 2.6.x * play-scala-chatroom-example/2.6.x: (52 commits) Nest play-scala-chatroom-example Updated with template-control on 2019-02-13T20:25:39.259Z (playframework#76) Upgrade branch 2.6.x using TemplateControl (playframework#74) Upgrade branch 2.6.x using TemplateControl (playframework#73) Upgrade branch 2.6.x using TemplateControl (playframework#72) Updated with template-control on 2019-01-08T14:44:41.803Z (playframework#70) Updated with template-control on 2019-01-04T17:13:23.812Z (playframework#65) Upgrade branch 2.6.x using TemplateControl (playframework#64) Upgrade branch 2.6.x using TemplateControl (playframework#61) Updated with template-control on 2018-09-11T20:14:50.057Z (playframework#60) Updated with template-control on 2018-08-20T20:37:13.669Z (playframework#59) Updated with template-control on 2018-07-19T01:58:55.835Z (playframework#57) Updated with template-control on 2018-07-16T18:38:45.034Z (playframework#56) Upgrade branch 2.6.x using TemplateControl (playframework#55) Updated with template-control on 2018-05-27T23:54:09.446Z (playframework#53) Updated with template-control on 2018-04-06T19:34:57.975Z (playframework#51) Updated with template-control on 2018-03-02T18:56:28.165Z (playframework#50) Upgrade branch 2.6.x using TemplateControl (playframework#49) Fix cross build to sbt 1.1.0 (playframework#48) Upgrade branch 2.6.x using TemplateControl (playframework#47) ...
This PR introduces multiple changes:
title
andbody
on the data it creates. This is necessary because this is a stateful tests and assertions were being mixed upString
and assert that contained thebody
substring. This assertion is wrong since the Play failure page (an HTML indicating the requested URI is missing) can be converted to aString
and it also contains the substringbody
.GET /v1/posts/
works. Equivalent to Small fixes for Play REST samples #48 but for the java sample.This PR is currently not passing all the tests (tested in
2.8.0-M3
and2.7.3
). The reason is a test expectingGET /v1/posts/
(the requests includes a trailing slash) fails.This is related to playframework/playframework#8850, #47 and #48