Skip to content

Commit

Permalink
GH-301 - Polishing.
Browse files Browse the repository at this point in the history
Formatting, visibility. Some refactorings in Neo4jEventPublicationRepository.
  • Loading branch information
odrotbohm committed Sep 20, 2023
1 parent 4e069b9 commit ffb9495
Show file tree
Hide file tree
Showing 12 changed files with 493 additions and 358 deletions.
114 changes: 57 additions & 57 deletions spring-modulith-events/spring-modulith-events-neo4j/pom.xml
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.springframework.modulith</groupId>
<artifactId>spring-modulith-events</artifactId>
<version>1.1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<name>Spring Modulith - Events - Neo4j-based repository</name>
<artifactId>spring-modulith-events-neo4j</artifactId>

<properties>
<module.name>org.springframework.modulith.events.neo4j</module.name>
</properties>

<dependencies>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>spring-modulith-events-core</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-neo4j</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>neo4j</artifactId>
<version>1.19.0</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<version>1.19.0</version>
<scope>test</scope>
</dependency>

</dependencies>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.springframework.modulith</groupId>
<artifactId>spring-modulith-events</artifactId>
<version>1.1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<name>Spring Modulith - Events - Neo4j-based repository</name>
<artifactId>spring-modulith-events-neo4j</artifactId>

<properties>
<module.name>org.springframework.modulith.events.neo4j</module.name>
</properties>

<dependencies>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>spring-modulith-events-core</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-neo4j</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>neo4j</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>

</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
/*
* Copyright 2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.modulith.events.neo4j;

import java.time.Instant;
import java.util.UUID;

/**
*
* The event publication entity definition.
*
* @author Gerrit Meier
* @since 1.1
*/
public class Neo4jEventPublication {
class Neo4jEventPublication {

public final UUID identifier;
public final Instant publicationDate;
Expand All @@ -19,12 +34,13 @@ public class Neo4jEventPublication {

public Instant completionDate;

public Neo4jEventPublication(UUID identifier, Instant publicationDate, String listenerId, Object event, String eventHash) {
public Neo4jEventPublication(UUID identifier, Instant publicationDate, String listenerId, Object event,
String eventHash) {

this.identifier = identifier;
this.publicationDate = publicationDate;
this.listenerId = listenerId;
this.event = event;
this.eventHash = eventHash;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,19 @@
import org.springframework.modulith.events.core.EventSerializer;

/**
* Auto-configuration to register a {@link Neo4jEventPublicationRepository}, a default {@link Configuration} and a
* {@link Neo4jIndexInitializer} if enabled.
*
* @author Gerrit Meier
* @since 1.1
*/
@AutoConfiguration
@AutoConfigureBefore(EventPublicationAutoConfiguration.class)
public class Neo4jEventPublicationAutoConfiguration implements EventPublicationConfigurationExtension {
class Neo4jEventPublicationAutoConfiguration implements EventPublicationConfigurationExtension {

@Bean
Neo4jEventPublicationRepository neo4jEventPublicationRepository(Neo4jClient neo4jClient, Configuration cypherDslConfiguration, EventSerializer eventSerializer) {
Neo4jEventPublicationRepository neo4jEventPublicationRepository(Neo4jClient neo4jClient,
Configuration cypherDslConfiguration, EventSerializer eventSerializer) {
return new Neo4jEventPublicationRepository(neo4jClient, cypherDslConfiguration, eventSerializer);
}

Expand Down
Loading

0 comments on commit ffb9495

Please sign in to comment.