Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace some magic values and upgrade the neo4j-driver version #87

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<dependency>
<groupId>org.neo4j.driver</groupId>
<artifactId>neo4j-java-driver</artifactId>
<version>5.9.0</version>
<version>5.12.0</version>
</dependency>
<!-- end::bolt-dependency[] -->
<dependency>
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/example/movies/Environment.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ public class Environment {

private static final String DEFAULT_PASS = "movies";

private static final int DEFAULT_PORT = 8080;

private static final String VERSION_PREFIX = "4";

public static int getPort() {
String webPort = System.getenv("PORT");
if (webPort == null || webPort.isEmpty()) {
return 8080;
return DEFAULT_PORT;
}
return Integer.parseInt(webPort);
}
Expand All @@ -31,7 +35,7 @@ public static String getNeo4jUrl() {

public static String getNeo4jDatabase() {
String neo4jVersion = System.getenv("NEO4J_VERSION");
if (neo4jVersion == null || neo4jVersion.startsWith("4")) {
if (neo4jVersion == null || neo4jVersion.startsWith(VERSION_PREFIX)) {
String database = System.getenv("NEO4J_DATABASE");
if (database == null || database.isEmpty()) {
return DEFAULT_DATABASE;
Expand Down