0

I have a parameterized test class

@RunWith(Parameterized.class)
class Tests{
    private int count;
    MyClass object;

   @Parameters
    public static Collection<Object[]> data() {
        return Arrays.asList(new Object[][] {     
             { 0, new MyClass()}
       });
}}

Now, there's a call in the MyClass constructor that I want to stub out using non strict expectations. Is it possible to do this?

EDIT: I've tried @Rogério's suggestion by Adding the following:

public static class MockedExternalClass extends MockUp<ExternalClass> {
        public static boolean makeExternalCall() {
            return true;
        }
    }


@BeforeClass
public static void beforeClass() {
    new MockedExternalClass();
}

However, the call doesn't get stubbed out and calls the original function anyway.

deborah-digges
  • 1,165
  • 11
  • 19

0 Answers0