{"action":"created","issue":{"url":"https://api.github.com/repos/junit-team/junit4/issues/1329","repository_url":"https://api.github.com/repos/junit-team/junit4","labels_url":"https://api.github.com/repos/junit-team/junit4/issues/1329/labels{/name}","comments_url":"https://api.github.com/repos/junit-team/junit4/issues/1329/comments","events_url":"https://api.github.com/repos/junit-team/junit4/issues/1329/events","html_url":"https://github.com/junit-team/junit4/issues/1329","id":160842278,"number":1329,"title":"assumeTrue doesn't work in @Parameters methods","user":{"login":"garfieldnate","id":778453,"avatar_url":"https://avatars.githubusercontent.com/u/778453?v=3","gravatar_id":"","url":"https://api.github.com/users/garfieldnate","html_url":"https://github.com/garfieldnate","followers_url":"https://api.github.com/users/garfieldnate/followers","following_url":"https://api.github.com/users/garfieldnate/following{/other_user}","gists_url":"https://api.github.com/users/garfieldnate/gists{/gist_id}","starred_url":"https://api.github.com/users/garfieldnate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garfieldnate/subscriptions","organizations_url":"https://api.github.com/users/garfieldnate/orgs","repos_url":"https://api.github.com/users/garfieldnate/repos","events_url":"https://api.github.com/users/garfieldnate/events{/privacy}","received_events_url":"https://api.github.com/users/garfieldnate/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/junit-team/junit4/labels/needs-more-info","name":"needs-more-info","color":"4ae6c7"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2016-06-17T08:58:35Z","updated_at":"2016-08-28T09:00:54Z","closed_at":null,"body":"My test class loads some expensive resources in the parameters function, so I want to skip that step if the entire class of tests is going to be skipped anyway. However, when I use `assumeTrue` in the parameters function the tests fail with the following:\r\n\r\n\torg.junit.AssumptionViolatedException: got: <false>, expected: is <true>\r\n\t\tat org.junit.Assume.assumeThat(Assume.java:95)\r\n\t\tat org.junit.Assume.assumeTrue(Assume.java:41)\r\n\t\tat ExampleTest.getParams(ExampleTest.java:17)\r\n\r\nI am running JUnit 4.12 within Eclipse. MWE below:\r\n\r\n\timport static org.junit.Assume.assumeTrue;\r\n\t\r\n\timport java.util.Collection;\r\n\timport java.util.Collections;\r\n\t\r\n\timport org.junit.runner.RunWith;\r\n\timport org.junit.runners.Parameterized;\r\n\timport org.junit.runners.Parameterized.Parameters;\r\n\t\r\n\t@RunWith(Parameterized.class)\r\n\tpublic class ExampleTest {\r\n\t\r\n\t\t@Parameters(name = \"{index}: {1}\")\r\n\t\tpublic static Collection<Object[]> getParams() {\r\n\t//\t\tassumeTrue(false);//bad\r\n\t\t\treturn Collections.emptyList();\r\n\t\t}\r\n\t\t\r\n\t\tpublic ExampleTest(){\r\n\t\t\tassumeTrue(false);//okay\r\n\t\t}\r\n\t}"},"comment":{"url":"https://api.github.com/repos/junit-team/junit4/issues/comments/242964084","html_url":"https://github.com/junit-team/junit4/issues/1329#issuecomment-242964084","issue_url":"https://api.github.com/repos/junit-team/junit4/issues/1329","id":242964084,"user":{"login":"Tibor17","id":1045063,"avatar_url":"https://avatars.githubusercontent.com/u/1045063?v=3","gravatar_id":"","url":"https://api.github.com/users/Tibor17","html_url":"https://github.com/Tibor17","followers_url":"https://api.github.com/users/Tibor17/followers","following_url":"https://api.github.com/users/Tibor17/following{/other_user}","gists_url":"https://api.github.com/users/Tibor17/gists{/gist_id}","starred_url":"https://api.github.com/users/Tibor17/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tibor17/subscriptions","organizations_url":"https://api.github.com/users/Tibor17/orgs","repos_url":"https://api.github.com/users/Tibor17/repos","events_url":"https://api.github.com/users/Tibor17/events{/privacy}","received_events_url":"https://api.github.com/users/Tibor17/received_events","type":"User","site_admin":false},"created_at":"2016-08-28T09:00:54Z","updated_at":"2016-08-28T09:00:54Z","body":"if `aroundTest =true` nothing changed. If false then it is up to JUnit when parameters methods are called. It's clear that JUnit would not call the methods before @Test. Obviously before calling @Before or Rules."}}
{"actor":{"display_login":"Tibor17"}}