So I am trying to run JUnit parameterized tests along with non-parameterized tests in the same test class. But I am running into one error or the other. Has anyone tried this before and were they successful in doing so? I know other runners need to be used with the @PowerMockRunnerDelegate in order to run correctly. So here's what I came up with:
@RunWith(PowerMockRunner.class)
@PowerMockRunnerDelegate(Enclosed.class)
@PrepareForTest(Some.class)
@PowerMockIgnore("javax.management.*")
public class TestClass {
@PowerMockRunnerDelegate(Parameterized.class)
public static class ParameterizedTests {
}
@Test
public void nonParameterizedTestOne() {
}
@Test
public void nonParameterizedTestTwo() {
}
}
But I get the error:
Test class should have exactly one public zero-argument constructor
Without powermock, this situation can be easily handled with:
@RunWith(Enclosed.class)
public class TestClass {
@RunWith(Parameterized.class)
public static class ParameterizedTests {
}
@Test
public void nonParameterizedTestOne() {
}
@Test
public void nonParameterizedTestTwo() {
}
}
But I would definitely like to use powermock. Any solutions?