Skip to content

Regression: Cannot update from @Spring #8482

@hohwille

Description

@hohwille

I have a test that I can not get to working after upgrading from spring boot 1.3.x to 1.5.1
I replaced this:

@SpringApplicationConfiguration(classes = SpringBootTestConfig.class)

with

@SpringBootTest(webEnvironment = WebEnvironment.NONE, classes = SpringBootTestConfig.class)

But now I am getting this error

Caused by: java.lang.IllegalStateException: The following classes could not be excluded because they are not auto-configuration classes:
	- <mypackage>.AbstractServiceConfig
	at org.springframework.boot.autoconfigure.AutoConfigurationImportSelector.handleInvalidExcludes(AutoConfigurationImportSelector.java:192)
	at org.springframework.boot.autoconfigure.AutoConfigurationImportSelector.checkExcludedClasses(AutoConfigurationImportSelector.java:177)
	at org.springframework.boot.autoconfigure.AutoConfigurationImportSelector.selectImports(AutoConfigurationImportSelector.java:99)
	at org.springframework.context.annotation.ConfigurationClassParser.processDeferredImportSelectors(ConfigurationClassParser.java:537)
	... 38 more

My SpringBootTestConfig however looks like this:

@ComponentScan(excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = {
AbstractServiceConfig.class }))
@SpringBootApplication(exclude = { AbstractServiceConfig.class })
public class SpringBootTestConfig {
...
}

Could you give me any hints why the excludes are not working properly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: invalidAn issue that we don't feel is valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions