📍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

@ -34,22 +34,20 @@ import org.junit.jupiter.api.Test;
*
* @author George Aristy (george.aristy@gmail.com)
*/
public class FindCustomerTest {
class FindCustomerTest {
/**
* Returns the given result with no exceptions.
*/
@Test
public void noExceptions() throws Exception {
void noExceptions() throws Exception {
assertThat(new FindCustomer("123").perform(), is("123"));
}
/**
* Throws the given exception.
*
* @throws Exception the expected exception
*/
@Test
public void oneException() {
void oneException() {
var findCustomer = new FindCustomer("123", new BusinessException("test"));
assertThrows(BusinessException.class, findCustomer::perform);
}
@ -60,7 +58,7 @@ public class FindCustomerTest {
* @throws Exception not an expected exception
*/
@Test
public void resultAfterExceptions() throws Exception {
void resultAfterExceptions() throws Exception {
final var op = new FindCustomer(
"123",
new CustomerNotFoundException("not found"),

View File

@ -34,12 +34,12 @@ import org.junit.jupiter.api.Test;
*
* @author George Aristy (george.aristy@gmail.com)
*/
public class RetryExponentialBackoffTest {
class RetryExponentialBackoffTest {
/**
* Should contain all errors thrown.
*/
@Test
public void errors() {
void errors() {
final var e = new BusinessException("unhandled");
final var retry = new RetryExponentialBackoff<String>(
() -> {
@ -62,7 +62,7 @@ public class RetryExponentialBackoffTest {
* it to attempt twice.
*/
@Test
public void attempts() {
void attempts() {
final var e = new BusinessException("unhandled");
final var retry = new RetryExponentialBackoff<String>(
() -> {
@ -85,7 +85,7 @@ public class RetryExponentialBackoffTest {
* it to ignore the exception that will be thrown.
*/
@Test
public void ignore() {
void ignore() {
final var e = new CustomerNotFoundException("customer not found");
final var retry = new RetryExponentialBackoff<String>(
() -> {

View File

@ -34,12 +34,13 @@ import org.junit.jupiter.api.Test;
*
* @author George Aristy (george.aristy@gmail.com)
*/
public class RetryTest {
class RetryTest {
/**
* Should contain all errors thrown.
*/
@Test
public void errors() {
void errors() {
final var e = new BusinessException("unhandled");
final var retry = new Retry<String>(
() -> {
@ -62,7 +63,7 @@ public class RetryTest {
* it to attempt twice.
*/
@Test
public void attempts() {
void attempts() {
final var e = new BusinessException("unhandled");
final var retry = new Retry<String>(
() -> {
@ -85,7 +86,7 @@ public class RetryTest {
* it to ignore the exception that will be thrown.
*/
@Test
public void ignore() {
void ignore() {
final var e = new CustomerNotFoundException("customer not found");
final var retry = new Retry<String>(
() -> {