{"action":"created","issue":{"url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/423","labels_url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/423/labels{/name}","comments_url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/423/comments","events_url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/423/events","html_url":"https://github.com/joel-costigliola/assertj-core/issues/423","id":80877731,"number":423,"title":"Add \"expected\" value to AbstractIterableAssert.containsExactly assertion message","user":{"login":"elygre","id":23876,"avatar_url":"https://avatars.githubusercontent.com/u/23876?v=3","gravatar_id":"","url":"https://api.github.com/users/elygre","html_url":"https://github.com/elygre","followers_url":"https://api.github.com/users/elygre/followers","following_url":"https://api.github.com/users/elygre/following{/other_user}","gists_url":"https://api.github.com/users/elygre/gists{/gist_id}","starred_url":"https://api.github.com/users/elygre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elygre/subscriptions","organizations_url":"https://api.github.com/users/elygre/orgs","repos_url":"https://api.github.com/users/elygre/repos","events_url":"https://api.github.com/users/elygre/events{/privacy}","received_events_url":"https://api.github.com/users/elygre/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-26T09:25:57Z","updated_at":"2015-05-26T11:14:27Z","closed_at":null,"body":"The AbstractIterableAssert message does not contain the expected value, only the actual value. This makes it harder to use in a parameterized setting, like the one below:\r\n\r\n    // Verifies that searching for values returns only those values\r\n    for (String storageType : Arrays.asList(\"FILE\", \"TEXT\", \"URL\", \"XML\")) {\r\n        List<String> storage = searchFor(storageType);\r\n        assertThat(storage).containsExactly(storageType);\r\n    }\r\n\r\nThe error message does not tell me which what I was looking for, but only what I got -- which of the four iterations failed?\r\n\r\n    java.lang.AssertionError: \r\n    Actual and expected should have same size but actual size is:\r\n     <2>\r\n    while expected is:\r\n     <1>\r\n    Actual was:\r\n    <[\"XML\", \"TEXT\"]>\r\n\r\nThis can be contrasted with a simple `assertThat(\"hi\").isEqualTo(\"ho\")`:\r\n\r\n    org.junit.ComparisonFailure: \r\n    Expected :\"ho\"\r\n    Actual   :\"hi\"\r\n\r\nIt would be nice if the error message also included expected value:\r\n\r\n    java.lang.AssertionError: \r\n    Actual and expected should have same size but actual size is:\r\n     <2>\r\n    while expected is:\r\n     <1>\r\n    Expected was:           <-- New\r\n    <[\"TEXT\"]>              <-- New\r\n    Actual was:\r\n    <[\"XML\", \"TEXT\"]>\r\n"},"comment":{"url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/comments/105491627","html_url":"https://github.com/joel-costigliola/assertj-core/issues/423#issuecomment-105491627","issue_url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/423","id":105491627,"user":{"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},"created_at":"2015-05-26T11:14:27Z","updated_at":"2015-05-26T11:14:27Z","body":"I definitely agree.\r\nThanks for taking the time to report this."}}