Skip to content

Instantly share code, notes, and snippets.

@benauthor
Last active July 11, 2018 13:44
Show Gist options
  • Save benauthor/962ca3118070b1c7b3fe1b086da356fc to your computer and use it in GitHub Desktop.
Save benauthor/962ca3118070b1c7b3fe1b086da356fc to your computer and use it in GitHub Desktop.
Minimal spring-configured test setup
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = MyConfigurationClass.class)
public class MyTest {
@Autowired
private MyWhateverType myConfiguredBean;
@Test
public void testMyConfiguredBean() {
System.out.println("works");
System.out.println(myConfiguredBean);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment