{"action":"closed","issue":{"url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/699","repository_url":"https://api.github.com/repos/joel-costigliola/assertj-core","labels_url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/699/labels{/name}","comments_url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/699/comments","events_url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/699/events","html_url":"https://github.com/joel-costigliola/assertj-core/issues/699","id":163624966,"number":699,"title":"SoftAssertions: Add #fail(String) method.","user":{"login":"caugner","id":495429,"avatar_url":"https://avatars.githubusercontent.com/u/495429?v=3","gravatar_id":"","url":"https://api.github.com/users/caugner","html_url":"https://github.com/caugner","followers_url":"https://api.github.com/users/caugner/followers","following_url":"https://api.github.com/users/caugner/following{/other_user}","gists_url":"https://api.github.com/users/caugner/gists{/gist_id}","starred_url":"https://api.github.com/users/caugner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caugner/subscriptions","organizations_url":"https://api.github.com/users/caugner/orgs","repos_url":"https://api.github.com/users/caugner/repos","events_url":"https://api.github.com/users/caugner/events{/privacy}","received_events_url":"https://api.github.com/users/caugner/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/joel-costigliola/assertj-core/milestones/25","html_url":"https://github.com/joel-costigliola/assertj-core/milestones/2.6.0","labels_url":"https://api.github.com/repos/joel-costigliola/assertj-core/milestones/25/labels","id":1817108,"number":25,"title":"2.6.0","description":null,"creator":{"login":"joel-costigliola","id":382613,"avatar_url":"https://avatars.githubusercontent.com/u/382613?v=3","gravatar_id":"","url":"https://api.github.com/users/joel-costigliola","html_url":"https://github.com/joel-costigliola","followers_url":"https://api.github.com/users/joel-costigliola/followers","following_url":"https://api.github.com/users/joel-costigliola/following{/other_user}","gists_url":"https://api.github.com/users/joel-costigliola/gists{/gist_id}","starred_url":"https://api.github.com/users/joel-costigliola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joel-costigliola/subscriptions","organizations_url":"https://api.github.com/users/joel-costigliola/orgs","repos_url":"https://api.github.com/users/joel-costigliola/repos","events_url":"https://api.github.com/users/joel-costigliola/events{/privacy}","received_events_url":"https://api.github.com/users/joel-costigliola/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":10,"state":"open","created_at":"2016-06-09T06:59:07Z","updated_at":"2016-09-08T05:59:22Z","due_on":null,"closed_at":null},"comments":7,"created_at":"2016-07-04T08:15:07Z","updated_at":"2016-09-08T05:59:22Z","closed_at":"2016-09-08T05:59:22Z","body":"#### Summary\r\n\r\nJUnit has a `#fail(String)` method in order to make a test fail independently from a specific object (which `assertThat(...)` requires). In general, such a `#fail(String)` method can be used for complex assertions or whenever a sophisticated failure message is required. This would be useful to have in AssertJ, especially in combination with `SoftAssertions` that report several failures at once.\r\n\r\n#### Example\r\n\r\n```java\r\nCollection<Acme> acmes = ...;\r\nSoftAssertions softly = new SoftAssertions();\r\nfor (Acme acme : acmes) {\r\n  boolean matches = matchesComplexConditionThatIsSpecificToThisTest(acme);\r\n  if (!matches) {\r\n    softly.fail(\"Doesn't match complex condition: \" + acme);\r\n  }\r\n}\r\nsoftly.assertAll();\r\n```\r\n\r\nAs of 3.5.0, the following would be possible, but I think it's less clear and adds too much noise:  \r\n```java\r\nsoftly.assertThat(matches).as(acme + \" matches complex condition.\").isTrue();\r\n```\r\n\r\n#### Java 8 specific ?\r\n\r\n* NO  : create Pull Request from the `2.x` branch\r\n\r\n\r\n"}}
{"actor":{"display_login":"joel-costigliola"}}