is there anyone who would know the way how to use a @ComponentScan(basePackages = {}) from class inside "test" directory to point on a packages in "main" directory.

For instance:

@ComponentScan(basePackages = {, })
public class TestConfiguration{}

I tried this way but when i type the package name it doesn't recognize the ones outside the test directory

1 Answers

colter liang On Best Solutions

What do you mean? The value of "basePackages" should be a string array. So you can input any string there. Like:

@ComponentScan(basePackages = {"",
"","any package is ok" })