public abstract class AbstractDatabaseHandlerTest
extends java.lang.Object
The bulk of our class implementation are implementations of AsyncDominoJNX and the extension interfaces in the com.hcl.domino.keep.dbrequests package To facilitate testing of those, this base class provides the standard objects we need to mock in order to minimize boilerplate code in our test execution
Modifier and Type | Field and Description |
---|---|
protected com.hcl.domino.security.Acl |
acl |
protected com.hcl.domino.security.AclAccess |
aclAccess |
protected com.hcl.domino.DominoClient |
client |
protected com.hcl.domino.data.Database |
db |
protected java.lang.String |
eventbusId |
protected MockKeepFactory |
factory |
protected io.vertx.core.json.JsonObject |
incoming |
protected static org.slf4j.Logger |
logger |
protected java.lang.AutoCloseable |
mockHolder |
protected com.hcl.domino.keep.dbrequests.KeepJnxSession |
s |
protected TestSubscriberJson |
subscriber |
Constructor and Description |
---|
AbstractDatabaseHandlerTest() |
Modifier and Type | Method and Description |
---|---|
protected void |
beforeEach(io.vertx.core.Vertx vertx) |
protected void |
beforeEach2(org.junit.jupiter.api.TestInfo testInfo) |
protected void |
beforeEachEnd(org.junit.jupiter.api.TestInfo testInfo) |
protected void |
expectFailure(java.lang.Class<? extends java.lang.Exception> clazz,
com.hcl.domino.keep.dbrequests.AsyncDominoJNXBuffer request,
com.hcl.domino.keep.dbrequests.DbRequestParameters<io.vertx.core.buffer.Buffer> params,
java.lang.String errorMessage) |
protected void |
expectFailure(java.lang.Class<? extends java.lang.Exception> clazz,
com.hcl.domino.keep.dbrequests.AsyncDominoJNXJson request,
com.hcl.domino.keep.dbrequests.DbRequestParameters<io.vertx.core.json.JsonObject> params)
Shortcut function to capture failing UnitTest that throw Exceptions
|
protected void |
expectFailure(java.lang.Class<? extends java.lang.Exception> clazz,
com.hcl.domino.keep.dbrequests.AsyncDominoJNXJson request,
com.hcl.domino.keep.dbrequests.DbRequestParameters<io.vertx.core.json.JsonObject> params,
java.lang.String errorMessage)
Shortcut function to capture failing UnitTest that throw Exceptions
|
protected void |
expectFailureBuffer(java.lang.Class<? extends java.lang.Exception> clazz,
com.hcl.domino.keep.dbrequests.AsyncDominoJNXBuffer request,
com.hcl.domino.keep.dbrequests.DbRequestParameters<io.vertx.core.buffer.Buffer> params)
Shortcut function to capture failing UnitTest that throw Exceptions
|
protected void |
expectFailureBuffer(java.lang.Class<? extends java.lang.Exception> clazz,
com.hcl.domino.keep.dbrequests.AsyncDominoJNXBuffer request,
com.hcl.domino.keep.dbrequests.DbRequestParameters<io.vertx.core.buffer.Buffer> params,
java.lang.String errorMessage)
Shortcut function to capture failing UnitTest that throw Exceptions
|
protected void |
expectSuccess(com.hcl.domino.keep.dbrequests.AsyncDominoJNXJson request,
com.hcl.domino.keep.dbrequests.DbRequestParameters<io.vertx.core.json.JsonObject> params)
Shortcut function to capture success
|
protected com.hcl.domino.keep.dbrequests.DbRequestParameters<io.vertx.core.buffer.Buffer> |
getBufferParams(io.reactivex.Observer<io.vertx.core.buffer.Buffer> bufferSubscriber) |
protected com.hcl.domino.keep.dbrequests.DbRequestParameters<io.vertx.core.json.JsonObject> |
getJsonParams()
Provide all the parameters for a successful call to the process() method all database calls rely on
|
protected static final org.slf4j.Logger logger
@Mock protected com.hcl.domino.keep.dbrequests.KeepJnxSession s
@Mock protected com.hcl.domino.data.Database db
@Mock protected com.hcl.domino.security.Acl acl
@Mock protected com.hcl.domino.security.AclAccess aclAccess
@Mock protected com.hcl.domino.DominoClient client
protected MockKeepFactory factory
protected TestSubscriberJson subscriber
protected io.vertx.core.json.JsonObject incoming
protected java.lang.AutoCloseable mockHolder
protected java.lang.String eventbusId
@BeforeEach protected void beforeEach(io.vertx.core.Vertx vertx)
vertx
- @BeforeEach protected void beforeEach2(org.junit.jupiter.api.TestInfo testInfo)
@AfterEach protected void beforeEachEnd(org.junit.jupiter.api.TestInfo testInfo) throws java.lang.Exception
java.lang.Exception
protected void expectFailure(java.lang.Class<? extends java.lang.Exception> clazz, com.hcl.domino.keep.dbrequests.AsyncDominoJNXBuffer request, com.hcl.domino.keep.dbrequests.DbRequestParameters<io.vertx.core.buffer.Buffer> params, java.lang.String errorMessage)
protected void expectFailure(java.lang.Class<? extends java.lang.Exception> clazz, com.hcl.domino.keep.dbrequests.AsyncDominoJNXJson request, com.hcl.domino.keep.dbrequests.DbRequestParameters<io.vertx.core.json.JsonObject> params)
Shortcut function to capture failing UnitTest that throw Exceptions
clazz
- request
- params
- protected void expectFailure(java.lang.Class<? extends java.lang.Exception> clazz, com.hcl.domino.keep.dbrequests.AsyncDominoJNXJson request, com.hcl.domino.keep.dbrequests.DbRequestParameters<io.vertx.core.json.JsonObject> params, java.lang.String errorMessage)
Shortcut function to capture failing UnitTest that throw Exceptions
clazz
- request
- params
- errorMessage
- protected void expectFailureBuffer(java.lang.Class<? extends java.lang.Exception> clazz, com.hcl.domino.keep.dbrequests.AsyncDominoJNXBuffer request, com.hcl.domino.keep.dbrequests.DbRequestParameters<io.vertx.core.buffer.Buffer> params)
Shortcut function to capture failing UnitTest that throw Exceptions
clazz
- request
- params
- protected void expectFailureBuffer(java.lang.Class<? extends java.lang.Exception> clazz, com.hcl.domino.keep.dbrequests.AsyncDominoJNXBuffer request, com.hcl.domino.keep.dbrequests.DbRequestParameters<io.vertx.core.buffer.Buffer> params, java.lang.String errorMessage)
Shortcut function to capture failing UnitTest that throw Exceptions
clazz
- request
- params
- errorMessage
- protected void expectSuccess(com.hcl.domino.keep.dbrequests.AsyncDominoJNXJson request, com.hcl.domino.keep.dbrequests.DbRequestParameters<io.vertx.core.json.JsonObject> params) throws java.lang.Exception
Shortcut function to capture success
request
- params
- java.lang.Exception
- protected com.hcl.domino.keep.dbrequests.DbRequestParameters<io.vertx.core.buffer.Buffer> getBufferParams(io.reactivex.Observer<io.vertx.core.buffer.Buffer> bufferSubscriber) throws com.hcl.domino.keep.exceptions.KeepExceptionMissingParameters
com.hcl.domino.keep.exceptions.KeepExceptionMissingParameters
protected com.hcl.domino.keep.dbrequests.DbRequestParameters<io.vertx.core.json.JsonObject> getJsonParams() throws com.hcl.domino.keep.exceptions.KeepExceptionMissingParameters
Provide all the parameters for a successful call to the process() method all database calls rely on
com.hcl.domino.keep.exceptions.KeepExceptionMissingParameters