java - Why ExpectedException is deprecated in Spring -


on 1 side, there new @runwith annotation lets change unit test framework on fly. on other side spring documentations says org.springframework.test.annotation.expectedexception:

  • @deprecated of spring 3.1 in favor of using built-in support declaring expected exceptions in underlying testing framework (e.g., junit, testng, etc.)

as result code depend on unit test framework. please explain it.

and 2nd question. @ moment implement tests spring @runwith annotation. add junit specific org.junit.test annotation each test method. again, if understand correctly best way - write tests, change example junit onto testng. , spring @runwith helps me that. how can avoid using of org.junit.test annotation?

@runwith isn't spring annotation. it's junit one. doesn't let switch between junit , testng, seem think. instead, lets run junit tests in different ways, addition of spring test framework. in framework, spring has provided expectedexception time, it's no longer needed because recent versions of both junit , testng provide functionality now.


Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -