jeudi 4 juin 2015

I am trying to write Unit test cases using power mockito.

When using annotations @RunWith(PowerMockRunner.class) I am getting the following compilation error:-

TypeMismatch: cannot convert from Class<PowerMockRunner> to Class<? extends Runner>

Here is the code snippet. Using junit 4.8.1 and power mock 1.6.2.

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.modules.junit4.PowerMockRunner;

@RunWith(PowerMockRunner.class)
public class XXXTest {
    @Test
    public void testOne() {
        if (true)
            System.out.println("Success");
    }
}

Aucun commentaire:

Enregistrer un commentaire