when whole test class run - test1 passes, test2 fails with NPE when mocking call chain.
Passes in 1.31.
Is this bug? I don't see anything relevant in release notes.
Please see comments in code. Interface and class public visibility affects test result.
public class SpikeTest {
@Injectable
private SubInterface subInterface;
@Test
public void test1() {
test();
}
@Test
public void test2() {
test();
}
private void test() {
final String expected = "mocked";
new Expectations() {{
subInterface.getData().get();
result = expected;
}};
final String actual = subInterface.getData().get();
assertSame(actual, expected);
}
interface ParentInterface {
Data getData();
}
// both tests pass with default visibility
public interface SubInterface extends ParentInterface {
}
// first test fails with default visibility
// java.lang.IllegalAccessError: tried to access class SpikeTest$Data from class $Impl_SubInterface
public static class Data {
String get() {
throw new UnsupportedOperationException();
}
}
}
The text was updated successfully, but these errors were encountered:
1.32
testng 6.9.10
when whole test class run - test1 passes, test2 fails with NPE when mocking call chain.
Passes in 1.31.
Is this bug? I don't see anything relevant in release notes.
Please see comments in code. Interface and class public visibility affects test result.
The text was updated successfully, but these errors were encountered: