Skip to content

Commit 80f6086

Browse files
ciberkleidodrotbohm
andcommitted
GH-806 - Remove use of Lombok.
Co-authored-by: Oliver Drotbohm <oliver.drotbohm@broadcom.com>
1 parent d3de957 commit 80f6086

File tree

8 files changed

+22
-35
lines changed

8 files changed

+22
-35
lines changed

spring-modulith-events/spring-modulith-events-api/src/test/java/org/springframework/modulith/events/EventExternalizationConfigurationUnitTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,8 @@
1818
import static org.assertj.core.api.Assertions.*;
1919
import static org.springframework.modulith.events.EventExternalizationConfiguration.*;
2020

21-
import lombok.RequiredArgsConstructor;
22-
2321
import java.lang.annotation.Retention;
2422
import java.lang.annotation.RetentionPolicy;
25-
import java.util.List;
2623
import java.util.Map;
2724

2825
import org.junit.jupiter.api.Test;
@@ -160,11 +157,14 @@ static class AnotherSampleEvent {}
160157
@Externalized("::key")
161158
static class KeyOnlyAnnotated {}
162159

163-
@RequiredArgsConstructor
164160
static class WithKeyProperty {
165161

166162
private final String key;
167163

164+
WithKeyProperty(String key) {
165+
this.key = key;
166+
}
167+
168168
String getKey() {
169169
return key;
170170
}

spring-modulith-events/spring-modulith-events-core/src/test/java/org/springframework/modulith/events/support/PersistentApplicationEventMulticasterUnitTests.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
import static org.mockito.ArgumentMatchers.*;
2020
import static org.mockito.Mockito.*;
2121

22-
import lombok.AllArgsConstructor;
23-
2422
import java.util.List;
2523
import java.util.Map;
2624

@@ -132,8 +130,11 @@ static class ConditionalListener {
132130
void on(SampleEvent event) {}
133131
}
134132

135-
@AllArgsConstructor
136133
static class SampleEvent {
137134
public boolean supported;
135+
136+
public SampleEvent(boolean supported) {
137+
this.supported = supported;
138+
}
138139
}
139140
}

spring-modulith-events/spring-modulith-events-jdbc/src/test/java/org/springframework/modulith/events/jdbc/JdbcEventPublicationRepositoryIntegrationTests.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
import static org.mockito.ArgumentMatchers.*;
2121
import static org.mockito.Mockito.*;
2222

23-
import lombok.Value;
24-
2523
import java.lang.annotation.Retention;
2624
import java.lang.annotation.RetentionPolicy;
2725
import java.time.Instant;
@@ -485,10 +483,7 @@ class OracleWithNoDefinedSchemaName extends WithNoDefinedSchemaName {}
485483
@WithOracle
486484
class OracleWithDeleteCompletion extends WithDeleteCompletion {}
487485

488-
@Value
489-
private static final class TestEvent {
490-
String eventId;
491-
}
486+
private record TestEvent(String eventId) {}
492487

493488
private static final class Sample {}
494489

spring-modulith-events/spring-modulith-events-jpa/src/test/java/org/springframework/modulith/events/jpa/JpaEventPublicationAutoConfigurationIntegrationTests.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import static org.assertj.core.api.Assertions.*;
1919

2020
import example.ExampleApplication;
21-
import lombok.RequiredArgsConstructor;
2221

2322
import org.junit.jupiter.api.Test;
2423
import org.springframework.beans.factory.BeanFactory;
@@ -36,14 +35,17 @@
3635
@SpringBootTest
3736
@ContextConfiguration(classes = ExampleApplication.class)
3837
@TestConstructor(autowireMode = AutowireMode.ALL)
39-
@RequiredArgsConstructor
4038
class JpaEventPublicationAutoConfigurationIntegrationTests {
4139

4240
private final BeanFactory factory;
4341

4442
@MockitoBean EventSerializer serializer;
4543

46-
@Test // GH-10
44+
JpaEventPublicationAutoConfigurationIntegrationTests(BeanFactory factory) {
45+
this.factory = factory;
46+
}
47+
48+
@Test // GH-10
4749
void registersJpaEventPublicationPackageForAutoConfiguration() {
4850

4951
var examplePackage = ExampleApplication.class.getPackageName();

spring-modulith-events/spring-modulith-events-jpa/src/test/java/org/springframework/modulith/events/jpa/JpaEventPublicationConfigurationIntegrationTests.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import static org.assertj.core.api.Assertions.*;
1919

2020
import example.ExampleApplication;
21-
import lombok.RequiredArgsConstructor;
2221

2322
import org.junit.jupiter.api.Test;
2423
import org.springframework.boot.test.context.SpringBootTest;
@@ -36,14 +35,17 @@
3635
*/
3736
@SpringBootTest(classes = ExampleApplication.class)
3837
@TestConstructor(autowireMode = AutowireMode.ALL)
39-
@RequiredArgsConstructor
4038
class JpaEventPublicationConfigurationIntegrationTests {
4139

4240
private final ApplicationContext context;
4341

4442
@MockitoBean EventSerializer serializer;
4543

46-
@Test
44+
JpaEventPublicationConfigurationIntegrationTests(ApplicationContext context) {
45+
this.context = context;
46+
}
47+
48+
@Test
4749
void bootstrapsApplicationComponents() {
4850

4951
assertThat(context.getBean(EventPublicationRegistry.class)).isNotNull();

spring-modulith-events/spring-modulith-events-jpa/src/test/java/org/springframework/modulith/events/jpa/JpaEventPublicationRepositoryIntegrationTests.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,5 @@ private void savePublicationAt(LocalDateTime date) {
325325
em.persist(new JpaEventPublication(UUID.randomUUID(), date.toInstant(ZoneOffset.UTC), "", "", Object.class));
326326
}
327327

328-
@lombok.Value
329-
private static final class TestEvent {
330-
String eventId;
331-
}
328+
private record TestEvent(String eventId) {}
332329
}

spring-modulith-events/spring-modulith-events-mongodb/src/test/java/org/springframework/modulith/events/mongodb/MongoDbEventPublicationRepositoryTest.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
import static org.assertj.core.api.Assertions.*;
1919
import static org.junit.jupiter.api.Assumptions.*;
2020

21-
import lombok.Value;
22-
2321
import java.time.Instant;
2422
import java.time.LocalDateTime;
2523
import java.time.ZoneOffset;
@@ -312,8 +310,5 @@ void deletesPublicationsByIdentifier() {
312310
@TestPropertySource(properties = CompletionMode.PROPERTY + "=DELETE")
313311
static class WithDeleteCompletionTest extends MongoDbEventPublicationRepositoryTest {}
314312

315-
@Value
316-
private static final class TestEvent {
317-
String eventId;
318-
}
313+
private record TestEvent(String eventId) {}
319314
}

spring-modulith-events/spring-modulith-events-neo4j/src/test/java/org/springframework/modulith/events/neo4j/Neo4jEventPublicationRepositoryTest.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
import static org.junit.jupiter.api.Assumptions.*;
2020
import static org.mockito.Mockito.*;
2121

22-
import lombok.Value;
23-
2422
import java.time.Instant;
2523
import java.time.temporal.ChronoUnit;
2624
import java.util.List;
@@ -306,10 +304,7 @@ private TargetEventPublication createPublication(Object event) {
306304
@TestPropertySource(properties = CompletionMode.PROPERTY + "=DELETE")
307305
static class WithDeleteCompletionTest extends Neo4jEventPublicationRepositoryTest {}
308306

309-
@Value
310-
static class TestEvent {
311-
String eventId;
312-
}
307+
private record TestEvent(String eventId) {}
313308

314309
@Import({ TestApplication.class })
315310
@Configuration

0 commit comments

Comments
 (0)