[
https://issues.apache.org/jira/browse/SCB-1559?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Haishi Yao updated SCB-1559:
----------------------------
Description:
Currently most of our code use java.lang.System#currentTimeMillis to get the
current time.
This method is not convenient to mock.
It's recommended to search all of the place we use
java.lang.System#currentTimeMillis and replace them with java.time.Clock. And
it's better to provide a mock clock class in testscaffolding.
was:
Currently most of our code use java.lang.System#currentTimeMillis to get the
current time.
This method is not convenient to mock.
It's recommended to use java.time.Clock to get time for the convenience of UT
mock. And it's better to provide a mock clock class in testscaffolding.
> Use java.time.Clock instead of java.lang.System#currentTimeMillis to get time
> -----------------------------------------------------------------------------
>
> Key: SCB-1559
> URL: https://issues.apache.org/jira/browse/SCB-1559
> Project: Apache ServiceComb
> Issue Type: Task
> Components: Java-Chassis
> Reporter: Haishi Yao
> Assignee: Haishi Yao
> Priority: Minor
>
> Currently most of our code use java.lang.System#currentTimeMillis to get the
> current time.
> This method is not convenient to mock.
> It's recommended to search all of the place we use
> java.lang.System#currentTimeMillis and replace them with java.time.Clock. And
> it's better to provide a mock clock class in testscaffolding.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)