how to pass date via url parameter - junit test with dates
问题 I want to pass my Date via parameter, and I dont exactly know how to do it. I have tried EncodeUrl.encode(), but it didnt work (it is possible that I did something wrong) @Test public void getUsageCountersParam2Test() throws Exception { Date date = new Date(2017, 06, 23, 12, 39, 20); MvcResult result = mockMvc.perform(get(getUri("/usages?apiConsumerId=[1,2]&serviceId=1&dateFrom=" + date)).contentType(MediaType.APPLICATION_JSON)).andExpect(status().isOk()).andReturn(); ObjectMapper mapper =