Code cleanup (#1461)

* Code cleanup

* Fix flux tests

* Fix checkstyle errors

* Fix compile error
This commit is contained in:
Ilkka Seppälä
2020-07-30 20:28:47 +03:00
committed by GitHub
parent 5381387026
commit 417f21ed3d
243 changed files with 1154 additions and 1162 deletions

View File

@ -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;

View File

@ -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.

View File

@ -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;

View File

@ -32,7 +32,7 @@ import java.util.List;
*/
public class Saga {
private List<Chapter> chapters;
private final List<Chapter> chapters;
private Saga() {

View File

@ -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));

View File

@ -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() {