Skip to content

How to mock System with 1.16 #155

@ascassel

Description

@ascassel

I used to mock java.System to ensure that the tested code uses System.exit() with the expected return code - but so far I only get java.lang.IllegalArgumentException: Matching real methods not found for the following mocks:
test.Test$4#exit(int)
at test.Test$4.(Test.java:178)
......
new MockUp<System>()
{
@mock
public void exit( int code )
{
//verification code here
}
};
....

Is this no longer possible? Note that I use a IBM JAVA 7

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions