Skip to content

Commit

Permalink
GH-806 - Remove use of Lombok
Browse files Browse the repository at this point in the history
  • Loading branch information
ciberkleid committed Oct 24, 2024
1 parent 29bc84c commit 7005819
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@
import static org.assertj.core.api.Assertions.*;
import static org.springframework.modulith.events.EventExternalizationConfiguration.*;

import lombok.RequiredArgsConstructor;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.List;
import java.util.Map;

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

@RequiredArgsConstructor
static class WithKeyProperty {

private final String key;

WithKeyProperty(String key) {
this.key = key;
}

String getKey() {
return key;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
import static org.mockito.ArgumentMatchers.*;
import static org.mockito.Mockito.*;

import lombok.AllArgsConstructor;

import java.util.List;
import java.util.Map;

Expand Down Expand Up @@ -132,8 +130,11 @@ static class ConditionalListener {
void on(SampleEvent event) {}
}

@AllArgsConstructor
static class SampleEvent {
public boolean supported;

public SampleEvent(boolean supported) {
this.supported = supported;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
import static org.mockito.ArgumentMatchers.*;
import static org.mockito.Mockito.*;

import lombok.Value;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.time.Instant;
Expand Down Expand Up @@ -485,10 +483,7 @@ class OracleWithNoDefinedSchemaName extends WithNoDefinedSchemaName {}
@WithOracle
class OracleWithDeleteCompletion extends WithDeleteCompletion {}

@Value
private static final class TestEvent {
String eventId;
}
private record TestEvent(String eventId) {}

private static final class Sample {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import static org.assertj.core.api.Assertions.*;

import example.ExampleApplication;
import lombok.RequiredArgsConstructor;

import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.BeanFactory;
Expand All @@ -36,14 +35,17 @@
@SpringBootTest
@ContextConfiguration(classes = ExampleApplication.class)
@TestConstructor(autowireMode = AutowireMode.ALL)
@RequiredArgsConstructor
class JpaEventPublicationAutoConfigurationIntegrationTests {

private final BeanFactory factory;

@MockitoBean EventSerializer serializer;

@Test // GH-10
JpaEventPublicationAutoConfigurationIntegrationTests(BeanFactory factory) {
this.factory = factory;
}

@Test // GH-10
void registersJpaEventPublicationPackageForAutoConfiguration() {

var examplePackage = ExampleApplication.class.getPackageName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import static org.assertj.core.api.Assertions.*;

import example.ExampleApplication;
import lombok.RequiredArgsConstructor;

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
Expand All @@ -36,14 +35,17 @@
*/
@SpringBootTest(classes = ExampleApplication.class)
@TestConstructor(autowireMode = AutowireMode.ALL)
@RequiredArgsConstructor
class JpaEventPublicationConfigurationIntegrationTests {

private final ApplicationContext context;

@MockitoBean EventSerializer serializer;

@Test
JpaEventPublicationConfigurationIntegrationTests(ApplicationContext context) {
this.context = context;
}

@Test
void bootstrapsApplicationComponents() {

assertThat(context.getBean(EventPublicationRegistry.class)).isNotNull();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,5 @@ private void savePublicationAt(LocalDateTime date) {
em.persist(new JpaEventPublication(UUID.randomUUID(), date.toInstant(ZoneOffset.UTC), "", "", Object.class));
}

@lombok.Value
private static final class TestEvent {
String eventId;
}
private record TestEvent(String eventId) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
import static org.assertj.core.api.Assertions.*;
import static org.junit.jupiter.api.Assumptions.*;

import lombok.Value;

import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
Expand Down Expand Up @@ -312,8 +310,5 @@ void deletesPublicationsByIdentifier() {
@TestPropertySource(properties = CompletionMode.PROPERTY + "=DELETE")
static class WithDeleteCompletionTest extends MongoDbEventPublicationRepositoryTest {}

@Value
private static final class TestEvent {
String eventId;
}
private record TestEvent(String eventId) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
import static org.junit.jupiter.api.Assumptions.*;
import static org.mockito.Mockito.*;

import lombok.Value;

import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.List;
Expand Down Expand Up @@ -306,10 +304,7 @@ private TargetEventPublication createPublication(Object event) {
@TestPropertySource(properties = CompletionMode.PROPERTY + "=DELETE")
static class WithDeleteCompletionTest extends Neo4jEventPublicationRepositoryTest {}

@Value
static class TestEvent {
String eventId;
}
private record TestEvent(String eventId) {}

@Import({ TestApplication.class })
@Configuration
Expand Down

0 comments on commit 7005819

Please sign in to comment.