Setting Up a Test Context

Wherever possible, we want to leave Spring out of our tests and focus completely on the "unit" under test. However, sometimes it's necessary to access Spring components, such as services, repositories, or other beans. For this reason, we can setup a minimal test ApplicationContext to save us the overhead of starting an entire Spring ApplicationContext. This video demonstrates one approach for setting up a test context.