There is an existing api which is having the below code :
@GetMapping(value = "/getAmount")
public long getAmount(){
Date d = new Date();
long amountFetchedFromDb = callToDatabase(d);
return amountFetchedFromDb;
}
Now I need to change the functionality as below:
@GetMapping(value = "/getAmount")
public long getAmount(){
Date d = new Date();
<CALL TO A NEW REST API PASSING IT THE DATE d AND THE NEW API
WILL MAKE THE DB CALL AND RETURN THE AMOUNT>
return amount;
}
Now, I have created a new rest service which takes a java date as a path variable as below:
@GetMapping("/getAmount/{dateTo}")
public long getAmount(@PathVariable Date dateTo){
long amountFetchedFromDb = callToDatabase(d);
return amountFetchedFromDb;
}
Now i need to test my new service.How to pass the date in the request below:
http://localhost:8080/getAmount/?
There is no date format being used in the existing api. it just creates a java date and passes in the query to Db. No conversion. So, i am not sure what will it pass to me. So, what I did was created a simple rest service which returns new Date(). When I ran it, I got in response 1530137142067(Today is 27June). What format is this?
I hope this is not too confusing. Please let me know if my query is not clear.