Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ object ActionServiceSourceGenerator {
val implSourcePath =
sourceDirectory.resolve(packagePath.resolve(implClassName + ".java"))

val interfaceClassName = className + "Interface"
val interfaceClassName = "Abstract" + className
val interfaceSourcePath =
generatedSourceDirectory.resolve(packagePath.resolve(interfaceClassName + ".java"))

Expand Down Expand Up @@ -168,7 +168,7 @@ object ActionServiceSourceGenerator {
) <> line <>
line <>
"/** An action. */" <> line <>
`class`("public abstract", className + "Interface") {
`class`("public abstract", "Abstract" + className) {
ssep(
service.commands.toSeq.map { command =>
"@Handler" <>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ object EntityServiceSourceGenerator {
val implSourcePath =
sourceDirectory.resolve(packagePath.resolve(implClassName + ".java"))

val interfaceClassName = className + "Interface"
val interfaceClassName = "Abstract" + className
val interfaceSourcePath =
generatedSourceDirectory.resolve(packagePath.resolve(interfaceClassName + ".java"))

Expand Down Expand Up @@ -321,7 +321,7 @@ object EntityServiceSourceGenerator {
case _: ModelBuilder.EventSourcedEntity => "/** An event sourced entity. */"
case _: ModelBuilder.ValueEntity => "/** A value entity. */"
}) <> line <>
`class`("public abstract", className + "Interface") {
`class`("public abstract", "Abstract" + className) {
line <>
(entity match {
case ModelBuilder.EventSourcedEntity(_, _, Some(state), _) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ object ViewServiceSourceGenerator {
val implSourcePath =
sourceDirectory.resolve(packagePath.resolve(implClassName + ".java"))

val interfaceClassName = className + "Interface"
val interfaceClassName = "Abstract" + className
val interfaceSourcePath =
generatedSourceDirectory.resolve(packagePath.resolve(interfaceClassName + ".java"))

Expand Down Expand Up @@ -159,7 +159,7 @@ object ViewServiceSourceGenerator {
) <> line <>
line <>
"/** A view. */" <> line <>
`class`("public abstract", className + "Interface") {
`class`("public abstract", "Abstract" + className) {
ssep(
service.transformedUpdates.toSeq.map { update =>
"@UpdateHandler" <>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ActionServiceSourceGeneratorSuite extends munit.FunSuite {

val packageName = "com.example.service"
val className = "MyServiceEntityImpl"
val interfaceClassName = "MyServiceEntityInterface"
val interfaceClassName = "AbstractMyServiceEntity"

val sourceDoc =
ActionServiceSourceGenerator.source(
Expand All @@ -40,7 +40,7 @@ class ActionServiceSourceGeneratorSuite extends munit.FunSuite {
|
|/** An action. */
|@Action
|public class MyServiceEntityImpl extends MyServiceEntityInterface {
|public class MyServiceEntityImpl extends AbstractMyServiceEntity {
| @Override
| public Reply<Empty> simpleMethod(ServiceOuterClass.MyRequest event, ActionContext ctx) {
| throw new RuntimeException("The command handler for `SimpleMethod` is not implemented, yet");
Expand Down Expand Up @@ -82,7 +82,7 @@ class ActionServiceSourceGeneratorSuite extends munit.FunSuite {
|import com.external.Empty;
|
|/** An action. */
|public abstract class MyServiceEntityInterface {
|public abstract class AbstractMyServiceEntity {
| @Handler
| public abstract Reply<Empty> simpleMethod(ServiceOuterClass.MyRequest event, ActionContext ctx);
|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class EntityServiceSourceGeneratorSuite extends munit.FunSuite {

val packageName = "com.example.service"
val className = "MyServiceEntityImpl"
val interfaceClassName = "MyServiceEntityInterface"
val interfaceClassName = "AbstractMyServiceEntity"
val entityType = "my-eventsourcedentity-persistence"

val sourceDoc =
Expand Down Expand Up @@ -44,7 +44,7 @@ class EntityServiceSourceGeneratorSuite extends munit.FunSuite {
|
|/** An event sourced entity. */
|@EventSourcedEntity(entityType = "my-eventsourcedentity-persistence")
|public class MyServiceEntityImpl extends MyServiceEntityInterface {
|public class MyServiceEntityImpl extends AbstractMyServiceEntity {
| @SuppressWarnings("unused")
| private final String entityId;
|
Expand Down Expand Up @@ -89,7 +89,7 @@ class EntityServiceSourceGeneratorSuite extends munit.FunSuite {

val packageName = "com.example.service"
val className = "MyServiceImpl"
val interfaceClassName = "MyServiceInterface"
val interfaceClassName = "AbstractMyService"
val entityType = "my-valueentity-persistence"

val sourceDoc =
Expand Down Expand Up @@ -118,7 +118,7 @@ class EntityServiceSourceGeneratorSuite extends munit.FunSuite {
|
|/** A value entity. */
|@ValueEntity(entityType = "my-valueentity-persistence")
|public class MyServiceImpl extends MyServiceInterface {
|public class MyServiceImpl extends AbstractMyService {
| @SuppressWarnings("unused")
| private final String entityId;
|
Expand Down Expand Up @@ -163,7 +163,7 @@ class EntityServiceSourceGeneratorSuite extends munit.FunSuite {
|import com.external.Empty;
|
|/** An event sourced entity. */
|public abstract class MyServiceEntityInterface {
|public abstract class AbstractMyServiceEntity {
|
| @Snapshot
| public abstract EntityOuterClass.MyState snapshot();
Expand Down Expand Up @@ -205,7 +205,7 @@ class EntityServiceSourceGeneratorSuite extends munit.FunSuite {
|import com.external.Empty;
|
|/** A value entity. */
|public abstract class MyServiceInterface {
|public abstract class AbstractMyService {
|
| public abstract Reply<Empty> set(ServiceOuterClass.SetValue command, CommandContext<EntityOuterClass.MyState> ctx);
|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ class SourceGeneratorSuite extends munit.FunSuite {

val implSource1 =
generatedSourceDirectory.resolve(
"com/example/service/persistence/MyEntity1Interface.java"
"com/example/service/persistence/AbstractMyEntity1.java"
)
val implSourceFile1 = implSource1.toFile
val implSource2 =
generatedSourceDirectory.resolve(
"com/example/service/persistence/MyEntity2Interface.java"
"com/example/service/persistence/AbstractMyEntity2.java"
)
val implSourceFile2 = implSource2.toFile
FileUtils.forceMkdir(implSourceFile1.getParentFile)
Expand Down Expand Up @@ -93,15 +93,15 @@ class SourceGeneratorSuite extends munit.FunSuite {
sources,
List(
generatedSourceDirectory.resolve(
"com/example/service/persistence/MyEntity1Interface.java"
"com/example/service/persistence/AbstractMyEntity1.java"
),
sourceDirectory.resolve("com/example/service/persistence/MyValueEntity2Impl.java"),
generatedSourceDirectory.resolve(
"com/example/service/persistence/MyValueEntity2Interface.java"
"com/example/service/persistence/AbstractMyValueEntity2.java"
),
sourceDirectory.resolve("com/example/service/persistence/MyEntity3Impl.java"),
generatedSourceDirectory.resolve(
"com/example/service/persistence/MyEntity3Interface.java"
"com/example/service/persistence/AbstractMyEntity3.java"
),
testSourceDirectory.resolve(
"com/example/service/persistence/MyEntity3Test.java"
Expand All @@ -111,7 +111,7 @@ class SourceGeneratorSuite extends munit.FunSuite {
),
sourceDirectory.resolve("com/example/service/MyService4Impl.java"),
generatedSourceDirectory.resolve(
"com/example/service/MyService4Interface.java"
"com/example/service/AbstractMyService4.java"
),
generatedSourceDirectory.resolve(
"com/example/service/MainComponentRegistrations.java"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ViewServiceSourceGeneratorSuite extends munit.FunSuite {

val packageName = "com.example.service"
val className = "MyServiceEntityImpl"
val interfaceClassName = "MyServiceEntityInterface"
val interfaceClassName = "AbstractMyServiceEntity"

val sourceDoc =
ViewServiceSourceGenerator.source(
Expand All @@ -38,7 +38,7 @@ class ViewServiceSourceGeneratorSuite extends munit.FunSuite {
|
|/** A view. */
|@View
|public class MyServiceEntityImpl extends MyServiceEntityInterface {
|public class MyServiceEntityImpl extends AbstractMyServiceEntity {
| @Override
| public ServiceOuterClass.ViewState created(EntityOuterClass.EntityCreated event, Optional<ServiceOuterClass.ViewState> state) {
| throw new RuntimeException("The update handler for `Created` is not implemented, yet");
Expand Down Expand Up @@ -73,7 +73,7 @@ class ViewServiceSourceGeneratorSuite extends munit.FunSuite {
|import java.util.Optional;
|
|/** A view. */
|public abstract class MyServiceEntityInterface {
|public abstract class AbstractMyServiceEntity {
| @UpdateHandler
| public abstract ServiceOuterClass.ViewState created(EntityOuterClass.EntityCreated event, Optional<ServiceOuterClass.ViewState> state);
|
Expand Down