📍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:
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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;
|
||||
|
@ -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[]{}));
|
||||
|
@ -32,7 +32,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
*/
|
||||
class SagaChoreographyTest {
|
||||
|
||||
|
||||
@Test
|
||||
void executeTest() {
|
||||
var sd = serviceDiscovery();
|
||||
|
Reference in New Issue
Block a user