rest - Integration Testing of similar crud resources -
lets have crud rest application multiple entities , we're thinking doing integration tests.
all these crud endpoints inherit same abstract crud class. best way of doing integration tests these routes.
test of abstract crud class , integration tests of api routes differ default crud operations
- dry (no need duplicate tests tested abstract crud route
- not integration tests (real crud methods never tested)
as not real integration test, possible miss errors render api endpoint in erroneous state
write generic test function test crud routes
- dry (just execute
testdefaultcrudbehaviour('/api-endpoint/entity'
) - but not damp
manually integration testing of crud routes
- damp
- not dry (a lot of code duplication, lot of noise)
yes, test abstract class in detail.
1) still need test subclasses see wired abstract class. may not need detail in subclass tests.
2) write test methods can re-run. regression testing process fundamental ensuring confidence in future change process.
3) while dry important principle in general, in testing, have lot of repetition. proper factoring of test code , case handling essential sanity, path coverage, tested automatically part of regression testing, important.
Comments
Post a Comment