Example code:
public void initiateArchiverBuilder(WcBrand wcBrand,
VaReportEntry vaReportEntry) {
VaBuildRequest vaBuildRequest = new VaBuildRequest();
vaBuildRequest.setObjectId(vaReportEntry.getId());
vaBuildRequest.setPriority(1);
vaBuildRequest.setBuilder("BUILDER_ARCHIVER");
vaBuildRequest.setAction("ARCHIVER_ACTION_ARCHIVE)";
vaBuildRequestDao.create(vaBuildRequest);
}
Junit :
You can verify the create method is called or not in junit.
Mockito.verify(vaReportEntryDao).create(Mockito.any(VaReportEntry.class));
public void initiateArchiverBuilder(WcBrand wcBrand,
VaReportEntry vaReportEntry) {
VaBuildRequest vaBuildRequest = new VaBuildRequest();
vaBuildRequest.setObjectId(vaReportEntry.getId());
vaBuildRequest.setPriority(1);
vaBuildRequest.setBuilder("BUILDER_ARCHIVER");
vaBuildRequest.setAction("ARCHIVER_ACTION_ARCHIVE)";
vaBuildRequestDao.create(vaBuildRequest);
}
Junit :
You can verify the create method is called or not in junit.
Mockito.verify(vaReportEntryDao).create(Mockito.any(VaReportEntry.class));
No comments:
Post a Comment