{"action":"created","issue":{"url":"https://api.github.com/repos/junit-team/junit/issues/351","labels_url":"https://api.github.com/repos/junit-team/junit/issues/351/labels{/name}","comments_url":"https://api.github.com/repos/junit-team/junit/issues/351/comments","events_url":"https://api.github.com/repos/junit-team/junit/issues/351/events","html_url":"https://github.com/junit-team/junit/issues/351","id":2031969,"number":351,"title":"missing current instance in TestRule apply()","user":{"login":"RainerW","id":118649,"avatar_url":"https://avatars.githubusercontent.com/u/118649?v=3","gravatar_id":"","url":"https://api.github.com/users/RainerW","html_url":"https://github.com/RainerW","followers_url":"https://api.github.com/users/RainerW/followers","following_url":"https://api.github.com/users/RainerW/following{/other_user}","gists_url":"https://api.github.com/users/RainerW/gists{/gist_id}","starred_url":"https://api.github.com/users/RainerW/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RainerW/subscriptions","organizations_url":"https://api.github.com/users/RainerW/orgs","repos_url":"https://api.github.com/users/RainerW/repos","events_url":"https://api.github.com/users/RainerW/events{/privacy}","received_events_url":"https://api.github.com/users/RainerW/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/junit-team/junit/labels/rules","name":"rules","color":"0b02e1"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":30,"created_at":"2011-10-24T09:45:33Z","updated_at":"2015-05-14T15:34:38Z","closed_at":null,"body":"I switched form 4.8 to 4.10 and decided to change my MethodRule's to TestRule ... bad idea.\r\n\r\nI'm missing a way to get the FrameworkMethod, and the current test instance, they are missing now in the apply method:\r\n\r\nold:\r\n  public Statement apply(final Statement base, final FrameworkMethod method, Object target)\r\n\r\nnew:\r\n  public Statement apply(final Statement base, final Description description)\r\n\r\nHow can i get them? I debugged and the actual Statement instance is of type InvokeMethod, this would have what i need, but dosn't have getter for the private fields.\r\n\r\nSo, at the moment i can just keep using MethodRule, but i'm afraid this will not work in further versions anymore. \r\n"},"comment":{"url":"https://api.github.com/repos/junit-team/junit/issues/comments/102074670","html_url":"https://github.com/junit-team/junit/issues/351#issuecomment-102074670","issue_url":"https://api.github.com/repos/junit-team/junit/issues/351","id":102074670,"user":{"login":"EarthCitizen","id":1094129,"avatar_url":"https://avatars.githubusercontent.com/u/1094129?v=3","gravatar_id":"","url":"https://api.github.com/users/EarthCitizen","html_url":"https://github.com/EarthCitizen","followers_url":"https://api.github.com/users/EarthCitizen/followers","following_url":"https://api.github.com/users/EarthCitizen/following{/other_user}","gists_url":"https://api.github.com/users/EarthCitizen/gists{/gist_id}","starred_url":"https://api.github.com/users/EarthCitizen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EarthCitizen/subscriptions","organizations_url":"https://api.github.com/users/EarthCitizen/orgs","repos_url":"https://api.github.com/users/EarthCitizen/repos","events_url":"https://api.github.com/users/EarthCitizen/events{/privacy}","received_events_url":"https://api.github.com/users/EarthCitizen/received_events","type":"User","site_admin":false},"created_at":"2015-05-14T15:34:38Z","updated_at":"2015-05-14T15:34:38Z","body":"It seems that the way that rules are designed need to be re-thought, scrapped and re-designed from scratch. Getting rid of MethodRule was a bit premature, and it is not possible for all existing rules to switch to the new TestRule because of needing to be given the instance of the test class. I talk about this a bit here: #1106 (MethodRules and rule chaining)\r\n\r\nHopefully rules can be redesigned for JUnit 5."}}