java - How to organise the tests of an expensive object -


i have class want test junit. creating of object of type involves lot of io, takes 5 seconds.

a mutable , want test different methods change a. in kind of dilemma:

  1. if create virgin object every test method, takes long.
  2. creating 1 huge test method lot of asserts seems bad idea isolate causes of possible errors.
  3. "repairing" object of type after each test methods seems dangerous because if repairing not done correctly, other test methods might fail without proper reason.
  4. i create deep copy of instance of every test method, means have change class test it.

what suggest?


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -