📍Use lombok, reformat, and optimize the code (#1560)

* Use lombok, reformat, and optimize the code

* Fix merge conflicts and some sonar issues

Co-authored-by: va1m <va1m@email.com>
This commit is contained in:
va1m
2021-03-13 13:19:21 +01:00
committed by GitHub
parent 0e26a6adb5
commit 5cf2fe009b
681 changed files with 2472 additions and 4966 deletions

View File

@ -23,8 +23,7 @@
package com.iluwatar.saga.choreography;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import lombok.extern.slf4j.Slf4j;
/**
* This pattern is used in distributed services to perform a group of operations atomically. This is
@ -44,8 +43,8 @@ import org.slf4j.LoggerFactory;
* @see com.iluwatar.saga.choreography.Saga
* @see Service
*/
@Slf4j
public class SagaApplication {
private static final Logger LOGGER = LoggerFactory.getLogger(SagaApplication.class);
/**
* main method.

View File

@ -23,8 +23,7 @@
package com.iluwatar.saga.orchestration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import lombok.extern.slf4j.Slf4j;
/**
* This pattern is used in distributed services to perform a group of operations atomically. This is
@ -45,8 +44,8 @@ import org.slf4j.LoggerFactory;
* @see SagaOrchestrator
* @see Service
*/
@Slf4j
public class SagaApplication {
private static final Logger LOGGER = LoggerFactory.getLogger(SagaApplication.class);
/**
* method to show common saga logic.

View File

@ -28,16 +28,15 @@ import static com.iluwatar.saga.orchestration.Saga.Result.CRASHED;
import static com.iluwatar.saga.orchestration.Saga.Result.FINISHED;
import static com.iluwatar.saga.orchestration.Saga.Result.ROLLBACK;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import lombok.extern.slf4j.Slf4j;
/**
* The orchestrator that manages all the transactions and directs the participant services to
* execute local transactions based on events.
*/
@Slf4j
public class SagaOrchestrator {
private static final Logger LOGGER = LoggerFactory.getLogger(SagaOrchestrator.class);
private final Saga saga;
private final ServiceDiscoveryService sd;
private final CurrentState state;

View File

@ -26,14 +26,13 @@ package com.iluwatar.saga.choreography;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import com.iluwatar.saga.orchestration.SagaApplication;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Test;
/***
* empty test
*/
class SagaApplicationTest {
@Test
void shouldExecuteWithoutException() {
assertDoesNotThrow(() -> SagaApplication.main(new String[]{}));

View File

@ -32,7 +32,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
*/
class SagaChoreographyTest {
@Test
void executeTest() {
var sd = serviceDiscovery();