{"action":"created","issue":{"url":"https://api.github.com/repos/jayway/powermock/issues/160","labels_url":"https://api.github.com/repos/jayway/powermock/issues/160/labels{/name}","comments_url":"https://api.github.com/repos/jayway/powermock/issues/160/comments","events_url":"https://api.github.com/repos/jayway/powermock/issues/160/events","html_url":"https://github.com/jayway/powermock/issues/160","id":96816366,"number":160,"title":"TestCase is prepared for test automatically if its fully qualified name starts with the same fully qualified name as a class that's prepared for test","user":{"login":"johanhaleby","id":187029,"avatar_url":"https://avatars.githubusercontent.com/u/187029?v=3","gravatar_id":"","url":"https://api.github.com/users/johanhaleby","html_url":"https://github.com/johanhaleby","followers_url":"https://api.github.com/users/johanhaleby/followers","following_url":"https://api.github.com/users/johanhaleby/following{/other_user}","gists_url":"https://api.github.com/users/johanhaleby/gists{/gist_id}","starred_url":"https://api.github.com/users/johanhaleby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johanhaleby/subscriptions","organizations_url":"https://api.github.com/users/johanhaleby/orgs","repos_url":"https://api.github.com/users/johanhaleby/repos","events_url":"https://api.github.com/users/johanhaleby/events{/privacy}","received_events_url":"https://api.github.com/users/johanhaleby/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jayway/powermock/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/jayway/powermock/labels/imported","name":"imported","color":"FFFFFF"},{"url":"https://api.github.com/repos/jayway/powermock/labels/Milestone-Release1.3","name":"Milestone-Release1.3","color":"FFFFFF"},{"url":"https://api.github.com/repos/jayway/powermock/labels/Priority-High","name":"Priority-High","color":"FFFFFF"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-07-23T13:37:10Z","updated_at":"2015-07-23T13:37:39Z","closed_at":null,"body":"_From [johan.ha...@gmail.com](https://code.google.com/u/105676376875942041029/) on August 21, 2009 08:31:53_\n\nUsing PowerMock 1.2.5, try running the following three classes in a\r\nJUnit launch:\r\n\r\n=== MockTest.java ===\r\npackage com.dummy;\r\n\r\nimport static org.junit.Assert.assertTrue;\r\n\r\nimport org.junit.Test;\r\nimport org.junit.runner.RunWith;\r\nimport org.powermock.api.easymock.PowerMock;\r\nimport org.powermock.core.classloader.annotations.PrepareForTest;\r\nimport org.powermock.modules.junit4.PowerMockRunner;\r\nimport org.powermock.reflect.Whitebox;\r\n\r\n@RunWith(PowerMockRunner.class)\r\n@PrepareForTest({Mock.class})\r\n\r\npublic class MockTest {\r\n\r\n   @Test\r\n   public void test() {\r\n       PowerMock.suppressConstructor(Mock.class);\r\n       Mock tested = new Mock();\r\n       Integer o = (Integer)Whitebox.getInternalState(tested,\r\n\"member\");\r\n       assertTrue(o == 23);\r\n   }\r\n}\r\n\r\n=== TestMock.java ===\r\npackage com.dummy;\r\n\r\nimport static org.junit.Assert.assertTrue;\r\n\r\nimport org.junit.Test;\r\nimport org.junit.runner.RunWith;\r\nimport org.powermock.api.easymock.PowerMock;\r\nimport org.powermock.core.classloader.annotations.PrepareForTest;\r\nimport org.powermock.modules.junit4.PowerMockRunner;\r\nimport org.powermock.reflect.Whitebox;\r\n\r\n@RunWith(PowerMockRunner.class)\r\n@PrepareForTest({Mock.class})\r\n\r\npublic class TestMock {\r\n\r\n   @Test\r\n   public void test() {\r\n       PowerMock.suppressConstructor(Mock.class);\r\n       Mock tested = new Mock();\r\n       Integer o = (Integer)Whitebox.getInternalState(tested,\r\n\"member\");\r\n       assertTrue(o == 23);\r\n   }\r\n}\r\n\r\n=== Mock.java ===\r\npackage com.dummy;\r\n\r\npublic class Mock {\r\n   public int member = 23;\r\n}\r\n\r\n=== END ===\r\n\r\nI find that TestMock passes, but MockTest fails. If I rename MockTest\r\ninto something NOT starting with the string \"Mock\", e.g. MTest, both\r\nwill pass. What is going on here?\n\n_Original issue: http://code.google.com/p/powermock/issues/detail?id=140_"},"comment":{"url":"https://api.github.com/repos/jayway/powermock/issues/comments/124102723","html_url":"https://github.com/jayway/powermock/issues/160#issuecomment-124102723","issue_url":"https://api.github.com/repos/jayway/powermock/issues/160","id":124102723,"user":{"login":"johanhaleby","id":187029,"avatar_url":"https://avatars.githubusercontent.com/u/187029?v=3","gravatar_id":"","url":"https://api.github.com/users/johanhaleby","html_url":"https://github.com/johanhaleby","followers_url":"https://api.github.com/users/johanhaleby/followers","following_url":"https://api.github.com/users/johanhaleby/following{/other_user}","gists_url":"https://api.github.com/users/johanhaleby/gists{/gist_id}","starred_url":"https://api.github.com/users/johanhaleby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johanhaleby/subscriptions","organizations_url":"https://api.github.com/users/johanhaleby/orgs","repos_url":"https://api.github.com/users/johanhaleby/repos","events_url":"https://api.github.com/users/johanhaleby/events{/privacy}","received_events_url":"https://api.github.com/users/johanhaleby/received_events","type":"User","site_admin":false},"created_at":"2015-07-23T13:37:39Z","updated_at":"2015-07-23T13:37:39Z","body":"_From [johan.ha...@gmail.com](https://code.google.com/u/105676376875942041029/) on September 07, 2009 23:11:00_\n\nPerhaps we should make use of wildcards (at least *) if subpackages should also be\r\nremoved?"}}