closeTo
method of hamcrest is not available for me to use in Eclipse. Other methods like is
, iscloseto
are available.
I am beginning to learn Spring and following a video tutorial. In it the instructor is using closeTo
inside is
to test a method. It does not work for me. The gradle dependency is there.
If you type the full qualified name Matchers.closeTo
which should work.
If you want to just type closeTo
and get Eclipse to suggest you the available methods , you have to configure static import in Eclipse first. Add org.hamcrest.Matchers.*
to the Favorites (See this ):
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.