Package io.keploy.service.mock
Class MockLib
java.lang.Object
io.keploy.service.mock.MockLib
This is a service class used by Mocking feature. This is the class where Java-sdk communicates with Keploy server to
record/store mocks and to perform mocking.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ArrayList<Service.Mock>GetAllMocks(Service.GetMockReq getMockReq) Gets all the mocks in the test mode from the serverSet the context according to the Keploy mode i.e.static booleanPutMock(String path, Service.Mock mock) Send recorded mocks to the serverstatic booleanStartRecordingMocks(String path, String mode, String name, Boolean overWrite)
-
Constructor Details
-
MockLib
Initialising Keploy instance and GRPC server- Parameters:
name- - App name
-
-
Method Details
-
NewContext
Set the context according to the Keploy mode i.e. if it is in test mode add all the mock data into the context- Returns:
- - Kcontext
-
StartRecordingMocks
-
GetAllMocks
Gets all the mocks in the test mode from the server- Parameters:
getMockReq- - contains mock path and app name- Returns:
- - all the mocks that are recorded
-
PutMock
Send recorded mocks to the server- Parameters:
path- - folder path where mock should be storedmock- - mock object- Returns:
- - Boolean that determines whether mocks are stored or not
-