GH-14 - Remove Lombok from production sources.
Polished a lot of Javadoc.
This commit is contained in:
@@ -15,8 +15,6 @@
|
||||
*/
|
||||
package com.acme.myproject.moduleA;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import org.springframework.context.ApplicationEventPublisher;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -24,11 +22,14 @@ import org.springframework.stereotype.Component;
|
||||
* @author Oliver Drotbohm
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class ServiceComponentA {
|
||||
|
||||
private final ApplicationEventPublisher publisher;
|
||||
|
||||
ServiceComponentA(ApplicationEventPublisher publisher) {
|
||||
this.publisher = publisher;
|
||||
}
|
||||
|
||||
public void fireEvent() {
|
||||
publisher.publishEvent(new SomeEventA("Message"));
|
||||
}
|
||||
|
||||
@@ -15,15 +15,10 @@
|
||||
*/
|
||||
package com.acme.myproject.moduleA;
|
||||
|
||||
import lombok.Value;
|
||||
|
||||
import org.jmolecules.event.annotation.DomainEvent;
|
||||
|
||||
/**
|
||||
* @author Oliver Drotbohm
|
||||
*/
|
||||
@Value
|
||||
@DomainEvent
|
||||
public class SomeEventA {
|
||||
String message;
|
||||
}
|
||||
public record SomeEventA(String message) {}
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
*/
|
||||
package com.acme.myproject.moduleB;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.acme.myproject.moduleA.ServiceComponentA;
|
||||
@@ -26,9 +24,13 @@ import com.acme.myproject.moduleB.internal.InternalComponentB;
|
||||
* @author Oliver Drotbohm
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class ServiceComponentB {
|
||||
|
||||
private final ServiceComponentA serviceComponentA;
|
||||
private final InternalComponentB internalComponentB;
|
||||
final ServiceComponentA serviceComponentA;
|
||||
final InternalComponentB internalComponentB;
|
||||
|
||||
ServiceComponentB(ServiceComponentA serviceComponentA, InternalComponentB internalComponentB) {
|
||||
this.serviceComponentA = serviceComponentA;
|
||||
this.internalComponentB = internalComponentB;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
*/
|
||||
package com.acme.myproject.moduleC;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.acme.myproject.moduleB.ServiceComponentB;
|
||||
@@ -25,7 +23,11 @@ import com.acme.myproject.moduleB.ServiceComponentB;
|
||||
* @author Oliver Drotbohm
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
class ServiceComponentC {
|
||||
private final ServiceComponentB serviceComponentB;
|
||||
|
||||
final ServiceComponentB serviceComponentB;
|
||||
|
||||
ServiceComponentC(ServiceComponentB serviceComponentB) {
|
||||
this.serviceComponentB = serviceComponentB;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
*/
|
||||
package com.acme.myproject.moduleD;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
import com.acme.myproject.moduleC.SomeValueC;
|
||||
@@ -25,8 +23,11 @@ import com.acme.myproject.moduleC.SomeValueC;
|
||||
* @author Oliver Drotbohm
|
||||
*/
|
||||
@ConfigurationProperties
|
||||
@RequiredArgsConstructor
|
||||
class ConfigurationPropertiesD {
|
||||
|
||||
private final SomeValueC value;
|
||||
final SomeValueC value;
|
||||
|
||||
ConfigurationPropertiesD(SomeValueC value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
*/
|
||||
package com.acme.myproject.stereotypes;
|
||||
|
||||
import lombok.Value;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -65,17 +63,6 @@ public class Stereotypes {
|
||||
@Component
|
||||
static class SomeAppInterfaceImplementation implements SomeAppInterface {}
|
||||
|
||||
@Value
|
||||
@ConfigurationProperties("org.springframework.modulith.sample")
|
||||
static class SomeConfigurationProperties {
|
||||
|
||||
/**
|
||||
* Some test property.
|
||||
*/
|
||||
String test;
|
||||
|
||||
public SomeConfigurationProperties(String test) {
|
||||
this.test = test;
|
||||
}
|
||||
}
|
||||
static record SomeConfigurationProperties(String test) {}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ class ModuleATest {
|
||||
context.getBean(ServiceComponentA.class).fireEvent();
|
||||
|
||||
TypedPublishedEvents<SomeEventA> matching = events.ofType(SomeEventA.class) //
|
||||
.matching(it -> it.getMessage().equals("Message"));
|
||||
.matching(it -> it.message().equals("Message"));
|
||||
|
||||
assertThat(matching).hasSize(1);
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ class DocumenterUnitTests {
|
||||
.groupBeans(modules.getModuleByName("stereotypes").orElseThrow(RuntimeException::new));
|
||||
|
||||
assertThat(result.keySet())
|
||||
.extracting(CanvasOptions.Grouping::getName)
|
||||
.extracting(it -> it.getName())
|
||||
.containsExactlyInAnyOrder("Controllers", "Services", "Repositories", "Event listeners",
|
||||
"Configuration properties", "Representations", "Interface implementations", "Others");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user