Package com.jk.web.test
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
FieldsModifier and TypeFieldDescriptionprotected 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 -
Method Summary
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
-
Field Details
-
facesContextMock
@Mock protected jakarta.faces.context.FacesContext facesContextMockRepresents mocked FacesContext used for testing. -
externalContextMock
@Mock protected jakarta.faces.context.ExternalContext externalContextMockRepresents mocked ExternalContext used for testing. -
flashMock
@Mock protected jakarta.faces.context.Flash flashMockRepresents mocked Flash object used for testing. -
requestMock
@Mock protected com.jk.web.test.MyRequestWrapper requestMockRepresents mocked HttpServletRequestWrapper used for testing. -
sessionMock
@Mock protected jakarta.servlet.http.HttpSession sessionMockRepresents 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
This method initializes the test environment before each test case is executed.- Throws:
IOException
- if an I/O exception has occurred.
-