3 ms·
I agree to some degree on a basic e2e plus swagger diffs, but > The good news is that you only need one test (or two for bidirectional) for each class. In both
by javcasas 3y ago
I agree to some degree on a basic e2e plus swagger diffs, but
> The good news is that you only need one test (or two for bidirectional) for each class. In both large and small companies I've never found this necessary.
this tells me you deal with very simplistic data. You are not testing advanced alternatives (algebraic data types), required/non required fields or default values. If you did, you would need at least 2 tests per case.
- stickfigure 3y agoNo. Field optionality and the content of values are server-side concerns that can be tested by making plain-old-Java method calls to the endpoint. The shape of serialized JSON doesn't need more than simple verification. And if you just live with default serialization (ie java format is the same as json format), it probably doesn't need to be tested at all.
- javcasas 3y agoImagine an authentication endpoint that accepts either a username/password or a SSH key. If you go the optional fields route, your parser will accept invalid combinations, for example password+ssh key. If you go the proper alternatives way, then you need a parser with two branches that parses user/password in one way, or ssh key the other way. You tell me simple verification is enough, hence you either have a parser that accepts bad data, or deal only with simplistic data so that the parser can't have branches.