can’t mock the object in the junit testing

I have a code below need to do the unit testing

public void applyX(){    
   FacesContext context = FacesContext.getCurrentInstance();

   if (!context.isValidationFailed()) {
      try {...

I wrote a testing code to mock the context

public class XsltConfigTest {

   private XC xc;

   private FacesContext facesContext;

   public void setUp() throws Exception {

   XC xc = new XC();

    facesContext = PowerMockito.mock(FacesContext.class);


   * @Before public void init() { MockitoAnnotations.initMocks(this); }

  public void testApplyX() {


I always got the below error. It seems the when statement didn’t kick in.

java.lang.ClassFormatError: JVMCFRE074 no Code attribute specified; class=javax/faces/context/FacesContext, method=()V, pc=0