我的源代码为:
response = getRequestService().retrieveResponse(baseRequest);
data = response.getStoredData(); ---> (1)
我把我的测试用例写成:
RequestService requestService = EasyMock.createNiceMock(RequestService .class);
BaseRequest baseRequest = new BaseRequest();
BaseResponse response = new BaseResponse();
expect(requestService .retrieveResponse(EasyMock.eq(baseRequest))).andReturn(response)
replay(requestService );
但是,当我运行测试时,我总是NullPointerException
在第 1 行得到一个。
有人可以帮我解决这个问题吗?
谢谢。