I'm trying to tell the ComponentScan annotation in Spring to import just a single class following this example: using ComponentScan or context:component-scan with only one class
@ComponentScan(
basePackages = {"com.example.controllers"},
useDefaultFilters = false,
includeFilters = {
@ComponentScan.Filter(type = ASSIGNABLE_TYPE, value = ExampleController.class)
})
class MyControllerTestConfig {
}
I believe this is ported to Scala as follows:
@Configuration
@ComponentScan(
basePackages = Array("com.example.controllers"),
useDefaultFilters = false,
includeFilters = Array(
new ComponentScan.Filter(type = ASSIGNABLE_TYPE, // fails
value = Array(classOf[ExampleController]))
))
class MyControllerTestConfig {
}
However, Scala doesn't let me use the word "type" as a parameter as it is a keyword in scala :-(
Is there a way to supply "type" as an annotation parameter in scala?