📍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,17 +23,15 @@
package com.iluwatar.monostate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import lombok.extern.slf4j.Slf4j;
/**
* The Server class. Each Server sits behind a LoadBalancer which delegates the call to the servers
* in a simplistic Round Robin fashion.
*/
@Slf4j
public class Server {
private static final Logger LOGGER = LoggerFactory.getLogger(Server.class);
public final String host;
public final int port;
public final int id;

View File

@ -31,7 +31,7 @@ import org.junit.jupiter.api.Test;
public class AppTest {
@Test
public void testMain() {
void testMain() {
App.main(new String[]{});
}

View File

@ -43,7 +43,7 @@ import org.junit.jupiter.api.Test;
public class LoadBalancerTest {
@Test
public void testSameStateAmongstAllInstances() {
void testSameStateAmongstAllInstances() {
final var firstBalancer = new LoadBalancer();
final var secondBalancer = new LoadBalancer();
firstBalancer.addServer(new Server("localhost", 8085, 6));
@ -54,7 +54,7 @@ public class LoadBalancerTest {
}
@Test
public void testServe() {
void testServe() {
final var server = mock(Server.class);
when(server.getHost()).thenReturn("testhost");
when(server.getPort()).thenReturn(1234);