org.springframework.test.context.junit.jupiter.comics.Cat Java Examples

The following examples show how to use org.springframework.test.context.junit.jupiter.comics.Cat. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SpringExtensionTests.java    From spring-test-junit5 with Apache License 2.0 5 votes vote down vote up
@Test
void junitAndSpringMethodInjectionCombined(@Autowired Cat kittyCat, TestInfo testInfo, ApplicationContext context,
		TestReporter testReporter) {

	assertNotNull(testInfo, "TestInfo should have been injected by JUnit");
	assertNotNull(testReporter, "TestReporter should have been injected by JUnit");

	assertNotNull(context, "ApplicationContext should have been injected by Spring");
	assertNotNull(kittyCat, "Cat should have been @Autowired by Spring");
}
 
Example #2
Source File: SpringExtensionTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Test
void junitAndSpringMethodInjectionCombined(@Autowired Cat kittyCat, TestInfo testInfo, ApplicationContext context,
		TestReporter testReporter) {

	assertNotNull(testInfo, "TestInfo should have been injected by JUnit");
	assertNotNull(testReporter, "TestReporter should have been injected by JUnit");

	assertNotNull(context, "ApplicationContext should have been injected by Spring");
	assertNotNull(kittyCat, "Cat should have been @Autowired by Spring");
}
 
Example #3
Source File: RegisterExtensionSpringExtensionTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Test
void junitAndSpringMethodInjectionCombined(@Autowired Cat kittyCat, TestInfo testInfo,
		ApplicationContext context, TestReporter testReporter) {

	assertNotNull(testInfo, "TestInfo should have been injected by JUnit");
	assertNotNull(testReporter, "TestReporter should have been injected by JUnit");

	assertNotNull(context, "ApplicationContext should have been injected by Spring");
	assertNotNull(kittyCat, "Cat should have been @Autowired by Spring");
}
 
Example #4
Source File: RegisterExtensionSpringExtensionTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Test
void junitAndSpringMethodInjectionCombined(@Autowired Cat kittyCat, TestInfo testInfo,
		ApplicationContext context, TestReporter testReporter) {

	assertNotNull(testInfo, "TestInfo should have been injected by JUnit");
	assertNotNull(testReporter, "TestReporter should have been injected by JUnit");

	assertNotNull(context, "ApplicationContext should have been injected by Spring");
	assertNotNull(kittyCat, "Cat should have been @Autowired by Spring");
}
 
Example #5
Source File: SpringExtensionTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Test
void junitAndSpringMethodInjectionCombined(@Autowired Cat kittyCat, TestInfo testInfo, ApplicationContext context,
		TestReporter testReporter) {

	assertNotNull(testInfo, "TestInfo should have been injected by JUnit");
	assertNotNull(testReporter, "TestReporter should have been injected by JUnit");

	assertNotNull(context, "ApplicationContext should have been injected by Spring");
	assertNotNull(kittyCat, "Cat should have been @Autowired by Spring");
}
 
Example #6
Source File: SpringExtensionTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Test
void autowiredParameterByTypeForPrimaryBean(@Autowired Cat primaryCat) {
	assertNotNull(primaryCat, "Primary cat should have been @Autowired by Spring");
	assertEquals("Catbert", primaryCat.getName(), "Primary cat's name");
}
 
Example #7
Source File: SpringExtensionTests.java    From spring-test-junit5 with Apache License 2.0 4 votes vote down vote up
@Test
void autowiredParameterByTypeForPrimaryBean(@Autowired Cat primaryCat) {
	assertNotNull(primaryCat, "Primary cat should have been @Autowired by Spring");
	assertEquals("Catbert", primaryCat.getName(), "Primary cat's name");
}
 
Example #8
Source File: TestConfig.java    From spring-test-junit5 with Apache License 2.0 4 votes vote down vote up
@Bean
Cat garfield() {
	return new Cat("Garfield");
}
 
Example #9
Source File: TestConfig.java    From spring-test-junit5 with Apache License 2.0 4 votes vote down vote up
@Primary
@Bean
Cat catbert() {
	return new Cat("Catbert");
}
 
Example #10
Source File: RegisterExtensionSpringExtensionTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Test
void autowiredParameterByTypeForPrimaryBean(@Autowired Cat primaryCat) {
	assertNotNull(primaryCat, "Primary cat should have been @Autowired by Spring");
	assertEquals("Catbert", primaryCat.getName(), "Primary cat's name");
}
 
Example #11
Source File: SpringExtensionParameterizedTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@ParameterizedTest
@CsvSource({ "garfield, Garfield", "catbert, Catbert" })
void cats(String beanName, String catName, ApplicationContext context) {
	assertEquals(catName, context.getBean(beanName, Cat.class).getName());
}
 
Example #12
Source File: TestConfig.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Primary
@Bean
Cat catbert() {
	return new Cat("Catbert");
}
 
Example #13
Source File: TestConfig.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Bean
Cat garfield() {
	return new Cat("Garfield");
}
 
Example #14
Source File: TestConfig.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Primary
@Bean
Cat catbert() {
	return new Cat("Catbert");
}
 
Example #15
Source File: RegisterExtensionSpringExtensionTests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Test
void autowiredParameterByTypeForPrimaryBean(@Autowired Cat primaryCat) {
	assertNotNull(primaryCat, "Primary cat should have been @Autowired by Spring");
	assertEquals("Catbert", primaryCat.getName(), "Primary cat's name");
}
 
Example #16
Source File: SpringExtensionParameterizedTests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@ParameterizedTest
@CsvSource({ "garfield, Garfield", "catbert, Catbert" })
void cats(String beanName, String catName, ApplicationContext context) {
	assertEquals(catName, context.getBean(beanName, Cat.class).getName());
}
 
Example #17
Source File: SpringExtensionTests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Test
void autowiredParameterByTypeForPrimaryBean(@Autowired Cat primaryCat) {
	assertNotNull(primaryCat, "Primary cat should have been @Autowired by Spring");
	assertEquals("Catbert", primaryCat.getName(), "Primary cat's name");
}
 
Example #18
Source File: TestConfig.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Bean
Cat garfield() {
	return new Cat("Garfield");
}