test_class.declarator: rateService
test_class.modifier: @MockBean
  	private
test_class.original_string: @MockBean
  	private RateService rateService;
test_class.type: RateService
test_class.var_name: rateService
test_class.declarator: mvc
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private MockMvc mvc;
test_class.type: MockMvc
test_class.var_name: mvc
test_class.file: trading-webapp/src/test/java/fr/ymanvieu/trading/webapp/rate/controller/RateControllerTest.java
test_class.identifier: RateControllerTest
test_case.body: @Test
  	public void testFindHistoricalValues() throws Exception {
  		// GIVEN
  		List<DateValue> histo = asList(
  				new DateValueImpl().setDate(Instant.now()).setValue(123.789d),
  				new DateValueImpl().setDate(Instant.now()).setValue(12d));
  		
  		when(rateService.getHistoricalValues(eq("USD"), eq("EUR"), any(), any())).thenReturn(histo);
  		
  		// WHEN
  		mvc.perform(get("/api/rate/history")
  				.param("fromcur", "USD")
  				.param("tocur", "EUR"))
  		.andExpect(jsonPath("$[0][0]").value(histo.get(0).getDate().toEpochMilli()))
  		.andExpect(jsonPath("$[0][1]").value(histo.get(0).getValue()))
  		.andExpect(jsonPath("$[1][0]").value(histo.get(1).getDate().toEpochMilli()))
  		.andExpect(jsonPath("$[1][1]").value(histo.get(1).getValue()));
  	}
test_case.class_method_signature: RateControllerTest.testFindHistoricalValues()
test_case.full_signature: @Test public void testFindHistoricalValues()
test_case.identifier: testFindHistoricalValues
test_case.invocations: asList setValue setDate now setValue setDate now thenReturn when getHistoricalValues eq eq any any andExpect andExpect andExpect andExpect perform param param get value jsonPath toEpochMilli getDate get value jsonPath getValue get value jsonPath toEpochMilli getDate get value jsonPath getValue get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testFindHistoricalValues()
focal_class.declarator: rateService
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private RateService rateService;
focal_class.type: RateService
focal_class.var_name: rateService
focal_class.declarator: rateMapper
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private RateDTOMapper rateMapper;
focal_class.type: RateDTOMapper
focal_class.var_name: rateMapper
focal_class.declarator: dateValueMapper
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private DateValueMapper dateValueMapper;
focal_class.type: DateValueMapper
focal_class.var_name: dateValueMapper
focal_class.file: trading-webapp/src/main/java/fr/ymanvieu/trading/webapp/rate/controller/RateController.java
focal_class.identifier: RateController
focal_class.class_method_signature: RateController.findAllLatest(Principal p)
focal_class.full_signature: @GetMapping("/latest") public List<RateDTO> findAllLatest(Principal p)
focal_class.identifier: findAllLatest
focal_class.modifiers: @GetMapping("/latest") public
focal_class.parameters: (Principal p)
focal_class.return: List<RateDTO>
focal_class.signature: List<RateDTO> findAllLatest(Principal p)
focal_class.class_method_signature: RateController.findLatest(@RequestParam String fromcur, @RequestParam String tocur)
focal_class.full_signature: @GetMapping(path = "/latest", params = { "fromcur", "tocur" }) public RateDTO findLatest(@RequestParam String fromcur, @RequestParam String tocur)
focal_class.identifier: findLatest
focal_class.modifiers: @GetMapping(path = "/latest", params = { "fromcur", "tocur" }) public
focal_class.parameters: (@RequestParam String fromcur, @RequestParam String tocur)
focal_class.return: RateDTO
focal_class.signature: RateDTO findLatest(@RequestParam String fromcur, @RequestParam String tocur)
focal_class.class_method_signature: RateController.findHistoricalValues(@RequestParam String fromcur, @RequestParam String tocur, 
  			@DateTimeFormat(iso = ISO.DATE_TIME) Instant startDate,
  			@DateTimeFormat(iso = ISO.DATE_TIME) Instant endDate)
focal_class.full_signature: @GetMapping("/history") public List<DateValueDTO> findHistoricalValues(@RequestParam String fromcur, @RequestParam String tocur, 
  			@DateTimeFormat(iso = ISO.DATE_TIME) Instant startDate,
  			@DateTimeFormat(iso = ISO.DATE_TIME) Instant endDate)
focal_class.identifier: findHistoricalValues
focal_class.modifiers: @GetMapping("/history") public
focal_class.parameters: (@RequestParam String fromcur, @RequestParam String tocur, 
  			@DateTimeFormat(iso = ISO.DATE_TIME) Instant startDate,
  			@DateTimeFormat(iso = ISO.DATE_TIME) Instant endDate)
focal_class.return: List<DateValueDTO>
focal_class.signature: List<DateValueDTO> findHistoricalValues(@RequestParam String fromcur, @RequestParam String tocur, 
  			@DateTimeFormat(iso = ISO.DATE_TIME) Instant startDate,
  			@DateTimeFormat(iso = ISO.DATE_TIME) Instant endDate)
focal_method.body: @GetMapping("/history")
  	public List<DateValueDTO> findHistoricalValues(@RequestParam String fromcur, @RequestParam String tocur, 
  			@DateTimeFormat(iso = ISO.DATE_TIME) Instant startDate,
  			@DateTimeFormat(iso = ISO.DATE_TIME) Instant endDate) {
  
  		if (startDate == null) {
  			startDate = rateService.getOldestRateDate(fromcur, tocur);
  		}
  
  		if (endDate == null) {
  			endDate = rateService.getNewestRateDate(fromcur, tocur);
  		}
  
  		return dateValueMapper.toDateValueDto(rateService.getHistoricalValues(fromcur, tocur, startDate, endDate));
  	}
focal_method.class_method_signature: RateController.findHistoricalValues(@RequestParam String fromcur, @RequestParam String tocur, 
  			@DateTimeFormat(iso = ISO.DATE_TIME) Instant startDate,
  			@DateTimeFormat(iso = ISO.DATE_TIME) Instant endDate)
focal_method.full_signature: @GetMapping("/history") public List<DateValueDTO> findHistoricalValues(@RequestParam String fromcur, @RequestParam String tocur, 
  			@DateTimeFormat(iso = ISO.DATE_TIME) Instant startDate,
  			@DateTimeFormat(iso = ISO.DATE_TIME) Instant endDate)
focal_method.identifier: findHistoricalValues
focal_method.invocations: getOldestRateDate getNewestRateDate toDateValueDto getHistoricalValues
focal_method.modifiers: @GetMapping("/history") public
focal_method.parameters: (@RequestParam String fromcur, @RequestParam String tocur, 
  			@DateTimeFormat(iso = ISO.DATE_TIME) Instant startDate,
  			@DateTimeFormat(iso = ISO.DATE_TIME) Instant endDate)
focal_method.return: List<DateValueDTO>
focal_method.signature: List<DateValueDTO> findHistoricalValues(@RequestParam String fromcur, @RequestParam String tocur, 
  			@DateTimeFormat(iso = ISO.DATE_TIME) Instant startDate,
  			@DateTimeFormat(iso = ISO.DATE_TIME) Instant endDate)