Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ITestContext gets Mocked when passed to test method #542

Closed
dasAnderl opened this issue Aug 14, 2018 · 2 comments
Closed

ITestContext gets Mocked when passed to test method #542

dasAnderl opened this issue Aug 14, 2018 · 2 comments
Assignees
Labels

Comments

@dasAnderl
Copy link

@dasAnderl dasAnderl commented Aug 14, 2018

Please provide the following information:

  • Version of JMockit that was used: 1.40
    TestNg version: 6.14.3
  • Description of the problem:

TestNg allows passing ITestContext to test or setup methods. If i do so, the context gets mocked by jmockit even if it was not annotated with any jmockit annotation

@Test
public void test (ITestContext ctx) {

	System.out.println(ctx); // -> gets mocked to MockInvocationHandler
	ctx.setAttribute("vehicle", "vehicle");
}

This means i am not able to pass anything to the test context. if i remove jmockit from the classpath, everything works as expected.

@rliesenfeld rliesenfeld self-assigned this Aug 18, 2018
@rliesenfeld
Copy link
Member

@rliesenfeld rliesenfeld commented Aug 19, 2018

Solved.

@adessaigne
Copy link

@adessaigne adessaigne commented Sep 24, 2018

Hello @rliesenfeld ,
It look like since this bug there's no longer any parameter mocks in TestNG. What should we use instead ? Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants