Refactor InMemoryStatRepository initialization with default stats constant, make Application.main public, update Java version to 21 in pom.xml, and remove redundant Jenkinsfile configuration.
This commit is contained in:
12
Jenkinsfile
vendored
12
Jenkinsfile
vendored
@@ -1,17 +1,5 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
|
|
||||||
|
|
||||||
environment {
|
|
||||||
JAVA_HOME = '/var/lib/jenkins/tools/hudson.model.JDK/jdk25'
|
|
||||||
PATH = "${JAVA_HOME}/bin:${PATH}"
|
|
||||||
}
|
|
||||||
|
|
||||||
tools {
|
|
||||||
jdk 'jdk25'
|
|
||||||
maven 'maven-3.9'
|
|
||||||
}
|
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
stage('Compilation') {
|
stage('Compilation') {
|
||||||
steps {
|
steps {
|
||||||
|
|||||||
2
pom.xml
2
pom.xml
@@ -27,7 +27,7 @@
|
|||||||
<url/>
|
<url/>
|
||||||
</scm>
|
</scm>
|
||||||
<properties>
|
<properties>
|
||||||
<java.version>25</java.version>
|
<java.version>21</java.version>
|
||||||
</properties>
|
</properties>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
public class Application {
|
public class Application {
|
||||||
|
|
||||||
static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
SpringApplication.run(Application.class, args);
|
SpringApplication.run(Application.class, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,11 +10,11 @@ import java.util.Map;
|
|||||||
@Stub
|
@Stub
|
||||||
public record InMemoryStatRepository(Map<String, Integer> stats) implements StatRepository {
|
public record InMemoryStatRepository(Map<String, Integer> stats) implements StatRepository {
|
||||||
|
|
||||||
|
|
||||||
|
private final static HashMap<String, Integer> DEFAULT_STATS = new HashMap<>(Map.of("joe", 1,"eoj", 3));
|
||||||
|
|
||||||
public InMemoryStatRepository() {
|
public InMemoryStatRepository() {
|
||||||
HashMap<String, Integer> stats1 = new HashMap<>();
|
this(DEFAULT_STATS);
|
||||||
stats1.put("joe", 1);
|
|
||||||
stats1.put("eoj", 3);
|
|
||||||
this(stats1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user