Added unit test

This commit is contained in:
Anirban Chatterjee
2020-10-06 22:33:24 +02:00
parent 14593ca02a
commit bd53673e2b
2 changed files with 26 additions and 5 deletions
@@ -1,4 +1,4 @@
package com.baeldung.annotations.componentscanautoconfigure;
package com.baeldung.annotations;
import com.baeldung.annotations.componentscanautoconfigure.teacher.Teacher;
import org.springframework.boot.SpringApplication;
@@ -6,15 +6,13 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.JdbcTemplateAutoConfiguration;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
//@Configuration
@ComponentScan(basePackages = {"com.baeldung.annotations.componentscanautoconfigure.healthcare", "com.baeldung.annotations.componentscanautoconfigure.employee"},
@ComponentScan(basePackages = {"com.baeldung.annotations.componentscanautoconfigure.healthcare",
"com.baeldung.annotations.componentscanautoconfigure.employee"},
basePackageClasses = Teacher.class)
@EnableAutoConfiguration(exclude = {JdbcTemplateAutoConfiguration.class})
//@EnableAutoConfiguration(excludeName = {"org.springframework.boot.autoconfigure.jdbc.JdbcTemplateAutoConfiguration"})
public class EmployeeApplication {
public static void main(String[] args) {
ApplicationContext context = SpringApplication.run(EmployeeApplication.class, args);
System.out.println("Configures Employee: " + context.containsBeanDefinition("employee"));