Mocking 无法模拟此方法

Mocking 无法模拟此方法,mocking,junit4,Mocking,Junit4,我试图模仿这个方法,但不管我写什么,它仍然显示为未被发现。 junit和mocking的新手,如果有人能帮忙的话 public ApiResponse getResponse(String error) { ObjectMapper mapper = new ObjectMapper(); ApiResponse result = null; try { result = mapper.rea

我试图模仿这个方法,但不管我写什么,它仍然显示为未被发现。 junit和mocking的新手,如果有人能帮忙的话

public ApiResponse getResponse(String error) {
            ObjectMapper mapper = new ObjectMapper();
            ApiResponse result = null;
            try {
                result = mapper.readValue(error, ApiResponse.class);
            } catch (IOException e1) {
                logger.error("Error occured Api call " + " is " + e1.getMessage(), e1);
            }
            return result;
        }