I have this below method that I need to test using Mockito. In this method, there is a mocked Class object "refDataCache" which calls a method and inside it, there is an arrow function. How to write test, so that I can enter inside the refDataCache.forAllMetaBlock method and check for metaBlockEntity.getMetaBlockId() and metaBlockEntity.getCode().
@GetMapping("/metaBlocks")
public Map<String, String> getMetaBlock() {
Map<String, String> response = new HashMap<>();
refDataCache.forAllMetaBlock(metaBlockEntity ->
response.put(Long.toString(metaBlockEntity.getMetaBlockId()), metaBlockEntity.getCode())
);
return response;
}
My test code is never able to enter inside the refDataCache.forAllMetaBlock and it directly jumps to return response on debugging.
Aucun commentaire:
Enregistrer un commentaire