unit test use EasyMock:Possible matches are marked with (+1):

    xiaoxiao2021-12-14  19

    某次写单元测试出现的一个小问题,针对某一个返回值为void的方法,程序中出现多次。

    源代码语句

    reservationRepository.save(EasyMock.isA(Reservation.class));

    reservationRepository.save(EasyMock.isA(Reservation.class));

    不同的地方出现两次调用这个方法,上面写法一直会出现Possible matches are marked with (+1):这个错误。

    之后换为下面的写法:

    reservationRepository.save(EasyMock.isA(Reservation.class));

    EasyMock.expectLastCall().anytimes(); 就可以解决那个问题了
    转载请注明原文地址: https://ju.6miu.com/read-964627.html

    最新回复(0)