Spring Support: Automatic configuration by @Import and @ComponentScan ("basePackages"/"basePackageClasses")
#KT-12135 Fixed #KT-12139 Fixed
This commit is contained in:
+8
@@ -0,0 +1,8 @@
|
||||
import org.springframework.context.annotation.ComponentScan
|
||||
import org.springframework.context.annotation.Configuration
|
||||
import foo.FooBean
|
||||
import bar.BarBean
|
||||
|
||||
@ComponentScan(basePackageClasses = arrayOf(FooBean::class, BarBean::class))
|
||||
@Configuration
|
||||
open class Config
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package bar
|
||||
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Component
|
||||
class BarBean {
|
||||
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
springConfig: ["Config.kt"],
|
||||
file: "foo/beans.kt",
|
||||
icon: "SpringJavaBean",
|
||||
tooltip: "Navigate to the spring bean declaration(s)",
|
||||
naming: "generic",
|
||||
targets: ["Config"]
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package foo
|
||||
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Component
|
||||
class Foo<caret>Bean {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import org.springframework.context.annotation.ComponentScan
|
||||
import org.springframework.context.annotation.Configuration
|
||||
|
||||
@ComponentScan(basePackages = arrayOf("foo", "bar"))
|
||||
@Configuration
|
||||
open class Config
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package bar
|
||||
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Component
|
||||
class BarBean {
|
||||
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
springConfig: ["Config.kt"],
|
||||
file: "foo/beans.kt",
|
||||
icon: "SpringJavaBean",
|
||||
tooltip: "Navigate to the spring bean declaration(s)",
|
||||
naming: "generic",
|
||||
targets: ["Config"]
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package foo
|
||||
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Component
|
||||
class Foo<caret>Bean {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import org.springframework.context.annotation.Import
|
||||
import org.springframework.context.annotation.Configuration
|
||||
import baz.Config2
|
||||
|
||||
@Configuration
|
||||
@Import(Config2::class)
|
||||
open class Config
|
||||
@@ -0,0 +1,8 @@
|
||||
package bar
|
||||
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Component
|
||||
class BarBean {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package baz
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan
|
||||
import org.springframework.context.annotation.Configuration
|
||||
import foo.FooBean
|
||||
import bar.BarBean
|
||||
|
||||
@ComponentScan(basePackageClasses = arrayOf(FooBean::class, BarBean::class))
|
||||
@Configuration
|
||||
open class Config2
|
||||
@@ -0,0 +1,8 @@
|
||||
package foo
|
||||
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Component
|
||||
class Foo<caret>Bean {
|
||||
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
springConfig: ["Config.kt"],
|
||||
file: "foo/beans.kt",
|
||||
icon: "SpringJavaBean",
|
||||
tooltip: "Navigate to the spring bean declaration(s)",
|
||||
naming: "generic",
|
||||
targets: []
|
||||
}
|
||||
+18
@@ -71,6 +71,18 @@ public class SpringClassAnnotatorTestGenerated extends AbstractSpringClassAnnota
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("componentScanWithBasePackageClasses/componentScanWithBasePackageClasses.test")
|
||||
public void testComponentScanWithBasePackageClasses_ComponentScanWithBasePackageClasses() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("ultimate/testData/spring/core/gutter/componentScanWithBasePackageClasses/componentScanWithBasePackageClasses.test");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("componentScanWithBasePackages/componentScanWithBasePackages.test")
|
||||
public void testComponentScanWithBasePackages_ComponentScanWithBasePackages() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("ultimate/testData/spring/core/gutter/componentScanWithBasePackages/componentScanWithBasePackages.test");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("contextBeanInjectionPoints/contextBeanInjectionPoints.test")
|
||||
public void testContextBeanInjectionPoints_ContextBeanInjectionPoints() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("ultimate/testData/spring/core/gutter/contextBeanInjectionPoints/contextBeanInjectionPoints.test");
|
||||
@@ -83,6 +95,12 @@ public class SpringClassAnnotatorTestGenerated extends AbstractSpringClassAnnota
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("importConfigClasses/importConfigClasses.test")
|
||||
public void testImportConfigClasses_ImportConfigClasses() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("ultimate/testData/spring/core/gutter/importConfigClasses/importConfigClasses.test");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("innerBean/innerBean.test")
|
||||
public void testInnerBean_InnerBean() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("ultimate/testData/spring/core/gutter/innerBean/innerBean.test");
|
||||
|
||||
Reference in New Issue
Block a user