Code cleanup (#1461)
* Code cleanup * Fix flux tests * Fix checkstyle errors * Fix compile error
This commit is contained in:
@ -33,7 +33,7 @@ import java.util.List;
|
||||
*/
|
||||
public class Saga {
|
||||
|
||||
private List<Chapter> chapters;
|
||||
private final List<Chapter> chapters;
|
||||
private int pos;
|
||||
private boolean forward;
|
||||
private boolean finished;
|
||||
@ -153,7 +153,7 @@ public class Saga {
|
||||
* outcoming parameter).
|
||||
*/
|
||||
public static class Chapter {
|
||||
private String name;
|
||||
private final String name;
|
||||
private ChapterResult result;
|
||||
private Object inValue;
|
||||
|
||||
|
@ -32,7 +32,7 @@ import java.util.Optional;
|
||||
* The class representing a service discovery pattern.
|
||||
*/
|
||||
public class ServiceDiscoveryService {
|
||||
private Map<String, ChoreographyChapter> services;
|
||||
private final Map<String, ChoreographyChapter> services;
|
||||
|
||||
/**
|
||||
* find any service.
|
||||
|
@ -29,8 +29,8 @@ package com.iluwatar.saga.orchestration;
|
||||
* @param <K> incoming value
|
||||
*/
|
||||
public class ChapterResult<K> {
|
||||
private K value;
|
||||
private State state;
|
||||
private final K value;
|
||||
private final State state;
|
||||
|
||||
public K getValue() {
|
||||
return value;
|
||||
|
@ -32,7 +32,7 @@ import java.util.List;
|
||||
*/
|
||||
public class Saga {
|
||||
|
||||
private List<Chapter> chapters;
|
||||
private final List<Chapter> chapters;
|
||||
|
||||
|
||||
private Saga() {
|
||||
|
@ -31,7 +31,7 @@ import java.util.Optional;
|
||||
* The class representing a service discovery pattern.
|
||||
*/
|
||||
public class ServiceDiscoveryService {
|
||||
private Map<String, OrchestrationChapter<?>> services;
|
||||
private final Map<String, OrchestrationChapter<?>> services;
|
||||
|
||||
public Optional<OrchestrationChapter> find(String service) {
|
||||
return Optional.ofNullable(services.getOrDefault(service, null));
|
||||
|
@ -34,7 +34,7 @@ import org.junit.Test;
|
||||
*/
|
||||
public class SagaOrchestratorInternallyTest {
|
||||
|
||||
private List<String> records = new ArrayList<>();
|
||||
private final List<String> records = new ArrayList<>();
|
||||
|
||||
@Test
|
||||
public void executeTest() {
|
||||
|
Reference in New Issue
Block a user