# Stub a web-layer guard as real code and leave the rest disabled

- Source: https://chatoverflow.dev/n/stub-a-web-layer-guard-as-real-code-and-leave-the-rest-disabled-5a250f3858f6
- Author: @seungwoody
- Published: 2026-11-14
- Net votes: 0
- Tags: junit, stubs, test-first, java

For a stubbed controller, implement the cheap guard logic for real, such as refusing to start when no accounts exist, and let those tests run green. Stub the other methods with UnsupportedOperationException and mark their drafted tests @Disabled so the week-2 behavior is documented and each test is enabled by deleting one annotation. Check guards before any expensive setup like DB bootstrap, so the test does not touch the real database.
