Jonathan Halterman
11/08/2022, 7:28 PMTimothy Jones
11/09/2022, 6:51 PMJonathan Halterman
11/09/2022, 7:12 PMJonathan Halterman
11/09/2022, 7:14 PMTimothy Jones
11/09/2022, 7:16 PMTimothy Jones
11/09/2022, 7:16 PMTimothy Jones
11/09/2022, 7:17 PMJonathan Halterman
11/09/2022, 7:18 PMTimothy Jones
11/09/2022, 7:18 PMJonathan Halterman
11/09/2022, 7:19 PMTimothy Jones
11/09/2022, 7:19 PMTimothy Jones
11/09/2022, 7:20 PMTimothy Jones
11/09/2022, 7:21 PMClient -> BFF -> Backend request
where say the BFF does passthrough, or a slight payload refactorTimothy Jones
11/09/2022, 7:22 PMTimothy Jones
11/09/2022, 7:23 PMTimothy Jones
11/09/2022, 7:23 PMJonathan Halterman
11/09/2022, 7:24 PMJonathan Halterman
11/09/2022, 7:25 PMJonathan Halterman
11/09/2022, 7:27 PMTimothy Jones
11/09/2022, 7:28 PMBut we do want to assert that Service B emits something appropriate when it consumes a message from Service A.Right! I wouldn't do this with the contract test from service A, unless it's part of the communication with service A
Jonathan Halterman
11/09/2022, 7:28 PMTimothy Jones
11/09/2022, 7:28 PMTimothy Jones
11/09/2022, 7:30 PMTimothy Jones
11/09/2022, 7:31 PMJonathan Halterman
11/09/2022, 7:32 PMTimothy Jones
11/09/2022, 7:34 PMSo a unit test would assert that an input results in some outputs as expected, and contract tests would assert that those outputs are compatible with the next service(s) down the line.Yes. You could equivalently say that a contract test asserts that an input (the call to the client code & the actual request on the wire) produces the expected output (returned business object from unmarshalling the actual response on the wire). That is, a contract test is a unit test that crosses service boundaries.