Skip to content

Commit f0ab90f

Browse files
committed
Adapt to initializr deprecations
1 parent caa6cc3 commit f0ab90f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

start-site/src/main/java/io/spring/start/site/extension/dependency/testcontainers/ImportTestcontainersConfigurationTestApplicationTypeCustomizer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ class ImportTestcontainersConfigurationTestApplicationTypeCustomizer
3232
@Override
3333
public void customize(TypeDeclaration typeDeclaration) {
3434
typeDeclaration.annotations()
35-
.add(ClassName.of("org.springframework.context.annotation.Import"), (annotation) -> annotation.set("value",
36-
TestContainersApplicationCodeProjectContributor.TESTCONTAINERS_CONFIGURATION_CLASS_NAME));
35+
.addSingle(ClassName.of("org.springframework.context.annotation.Import"), (annotation) -> annotation
36+
.set("value", TestContainersApplicationCodeProjectContributor.TESTCONTAINERS_CONFIGURATION_CLASS_NAME));
3737
}
3838

3939
}

start-site/src/main/java/io/spring/start/site/extension/dependency/testcontainers/TestContainersApplicationCodeProjectContributor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ private void createTestcontainersConfiguration(S sourceCode) {
101101
T testcontainersConfiguration = testcontainersConfigurationUnit
102102
.createTypeDeclaration(TESTCONTAINERS_CONFIGURATION_CLASS_NAME.getSimpleName());
103103
testcontainersConfiguration.annotations()
104-
.add(TEST_CONFIGURATION_CLASS_NAME, (annotation) -> annotation.set("proxyBeanMethods", false));
104+
.addSingle(TEST_CONFIGURATION_CLASS_NAME, (annotation) -> annotation.set("proxyBeanMethods", false));
105105
this.serviceConnections.values()
106106
.forEach((serviceConnection) -> configureServiceConnection(testcontainersConfiguration, serviceConnection));
107107
}
@@ -122,8 +122,8 @@ protected void customizeApplicationTypeDeclaration(S sourceCode, Consumer<T> cus
122122
}
123123

124124
protected void annotateContainerMethod(Annotatable annotable, String name) {
125-
annotable.annotations().add(BEAN_CLASS_NAME);
126-
annotable.annotations().add(SERVICE_CONNECTION_CLASS_NAME, (annotation) -> {
125+
annotable.annotations().addSingle(BEAN_CLASS_NAME);
126+
annotable.annotations().addSingle(SERVICE_CONNECTION_CLASS_NAME, (annotation) -> {
127127
if (name != null) {
128128
annotation.set("name", name);
129129
}

0 commit comments

Comments
 (0)