@WebMvcTest(Controller.class)
public class ControllerTest {
@Autowired
private MockMvc mvc;
@MockBean
private
HazelcastInstance hazelcastInstance;
@MockBean
private
HazelcastGetCache hazelcastGetCache;
@MockBean
private IMap<String, Set<String>> map;
@Autowired
private
Gson gson;
@Test
void testMap() throws Exception {
doReturn(map).when(hazelcastGetCache).getMap();
mvc.perform(get("/get/{mapName}", "map")
.accept(MediaType.APPLICATION_JSON)
.contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isOk());
}
}