I'm trying to wrap my head around Arquillian and am just not fundamentally understanding the difference between in-container
mode vs. as-client
mode.
My understanding is that, with Arquillian/ShrinkWrap:
- You create an archive that only contains the components you want to integrate and test with
- You stream this in-memory archive to an actual container (deploying it)
- You run the archive as a test inside the container
- You make an assertion about what will happen as a result of that test
So, from my perspective, everything just "feels" like it would always be in-container
, since the tests are always executing inside a container.
Please help me understand the differences between these two modes and what types of integration tests both modes are suited for. Bonus points for providing a concrete code example (and not the vague ones straight from the Reference Guide!) that explain why/how you run the tests in both modes. Thanks in advance!