我需要为具有条件的方法编写单元测试,并且需要询问如何首先为以下方法准备,执行和验证单元测试
(Select name from Employee(class) where eid='123')
这是我编写的测试,但未通过并给出nullpointerexception错误
public void onSpeedAlertActivationJob(ActivateSpeedAlert job) {
List definitions = job.getActivateSpeedAlertType().getSpeedAlertDefinition();
if (!JobVerifier.containsValetAlert(definitions)) {
return;
}
if (definitions.size() > 1) {
Log.w(LOG_TAG, "Received ValetAlert AND other definitions in one job");
sendSpeedAlertJobAcknowledgement(monitorings.speedalert.ErrorCodes.OTHER_ERROR, job.getId());
return;
}