Class JKManagedBeanTest

java.lang.Object
org.mockito.ArgumentMatchers
org.mockito.Mockito
com.jk.web.test.JKManagedBeanTest
Direct Known Subclasses:
JKWebStackManagedBeanTest

public class JKManagedBeanTest extends org.mockito.Mockito
This class is a unit test class for testing managed beans in a Jakarta Server Faces (JSF) application.
Version:
1.0
Author:
Dr. Jalal H. Kiswani
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected jakarta.faces.context.ExternalContext
    Represents mocked ExternalContext used for testing.
    protected jakarta.faces.context.FacesContext
    Represents mocked FacesContext used for testing.
    protected jakarta.faces.context.Flash
    Represents mocked Flash object used for testing.
    protected com.jk.web.test.MyRequestWrapper
    Represents mocked HttpServletRequestWrapper used for testing.
    protected jakarta.servlet.http.HttpSession
    Represents mocked HttpSession used for testing.

    Fields inherited from class org.mockito.Mockito

    CALLS_REAL_METHODS, RETURNS_DEEP_STUBS, RETURNS_DEFAULTS, RETURNS_MOCKS, RETURNS_SELF, RETURNS_SMART_NULLS
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    This method initializes the test environment before each test case is executed.
    static void
    This method initializes the test class before any test cases are executed.

    Methods inherited from class org.mockito.Mockito

    after, atLeast, atLeastOnce, atMost, atMostOnce, calls, clearAllCaches, clearInvocations, description, doAnswer, doCallRealMethod, doNothing, doReturn, doReturn, doThrow, doThrow, doThrow, framework, ignoreStubs, inOrder, lenient, mock, mock, mock, mock, mockConstruction, mockConstruction, mockConstruction, mockConstruction, mockConstruction, mockConstruction, mockConstructionWithAnswer, mockingDetails, mockitoSession, mockStatic, mockStatic, mockStatic, mockStatic, never, only, reset, spy, spy, timeout, times, validateMockitoUsage, verify, verify, verifyNoInteractions, verifyNoMoreInteractions, when, withSettings

    Methods inherited from class org.mockito.ArgumentMatchers

    any, any, anyBoolean, anyByte, anyChar, anyCollection, anyDouble, anyFloat, anyInt, anyIterable, anyList, anyLong, anyMap, anySet, anyShort, anyString, argThat, booleanThat, byteThat, charThat, contains, doubleThat, endsWith, eq, eq, eq, eq, eq, eq, eq, eq, eq, floatThat, intThat, isA, isNotNull, isNull, longThat, matches, matches, notNull, nullable, refEq, same, shortThat, startsWith

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • facesContextMock

      @Mock protected jakarta.faces.context.FacesContext facesContextMock
      Represents mocked FacesContext used for testing.
    • externalContextMock

      @Mock protected jakarta.faces.context.ExternalContext externalContextMock
      Represents mocked ExternalContext used for testing.
    • flashMock

      @Mock protected jakarta.faces.context.Flash flashMock
      Represents mocked Flash object used for testing.
    • requestMock

      @Mock protected com.jk.web.test.MyRequestWrapper requestMock
      Represents mocked HttpServletRequestWrapper used for testing.
    • sessionMock

      @Mock protected jakarta.servlet.http.HttpSession sessionMock
      Represents mocked HttpSession used for testing.
  • Constructor Details

    • JKManagedBeanTest

      public JKManagedBeanTest()
  • Method Details

    • initClass

      public static void initClass()
      This method initializes the test class before any test cases are executed.
    • init

      public void init() throws IOException
      This method initializes the test environment before each test case is executed.
      Throws:
      IOException - if an I/O exception has occurred.