📍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,16 +23,14 @@
package com.iluwatar.model.view.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import lombok.extern.slf4j.Slf4j;
/**
* GiantView displays the giant.
*/
@Slf4j
public class GiantView {
private static final Logger LOGGER = LoggerFactory.getLogger(GiantView.class);
public void displayGiant(GiantModel giant) {
LOGGER.info(giant.toString());
}

View File

@ -41,7 +41,7 @@ public class GiantControllerTest {
* Verify if the controller passes the health level through to the model and vice versa
*/
@Test
public void testSetHealth() {
void testSetHealth() {
final var model = mock(GiantModel.class);
final var view = mock(GiantView.class);
final var controller = new GiantController(model, view);
@ -65,7 +65,7 @@ public class GiantControllerTest {
* Verify if the controller passes the fatigue level through to the model and vice versa
*/
@Test
public void testSetFatigue() {
void testSetFatigue() {
final var model = mock(GiantModel.class);
final var view = mock(GiantView.class);
final var controller = new GiantController(model, view);
@ -89,7 +89,7 @@ public class GiantControllerTest {
* Verify if the controller passes the nourishment level through to the model and vice versa
*/
@Test
public void testSetNourishment() {
void testSetNourishment() {
final var model = mock(GiantModel.class);
final var view = mock(GiantView.class);
final var controller = new GiantController(model, view);
@ -110,7 +110,7 @@ public class GiantControllerTest {
}
@Test
public void testUpdateView() {
void testUpdateView() {
final var model = mock(GiantModel.class);
final var view = mock(GiantView.class);
final var controller = new GiantController(model, view);

View File

@ -38,7 +38,7 @@ public class GiantModelTest {
* Verify if the health value is set properly though the constructor and setter
*/
@Test
public void testSetHealth() {
void testSetHealth() {
final var model = new GiantModel(Health.HEALTHY, Fatigue.ALERT, Nourishment.SATURATED);
assertEquals(Health.HEALTHY, model.getHealth());
var messageFormat = "The giant looks %s, alert and saturated.";
@ -53,7 +53,7 @@ public class GiantModelTest {
* Verify if the fatigue level is set properly though the constructor and setter
*/
@Test
public void testSetFatigue() {
void testSetFatigue() {
final var model = new GiantModel(Health.HEALTHY, Fatigue.ALERT, Nourishment.SATURATED);
assertEquals(Fatigue.ALERT, model.getFatigue());
var messageFormat = "The giant looks healthy, %s and saturated.";
@ -68,7 +68,7 @@ public class GiantModelTest {
* Verify if the nourishment level is set properly though the constructor and setter
*/
@Test
public void testSetNourishment() {
void testSetNourishment() {
final var model = new GiantModel(Health.HEALTHY, Fatigue.ALERT, Nourishment.SATURATED);
assertEquals(Nourishment.SATURATED, model.getNourishment());
var messageFormat = "The giant looks healthy, alert and %s.";

View File

@ -60,7 +60,7 @@ public class GiantViewTest {
* standard out stream, nothing more, nothing less.
*/
@Test
public void testDisplayGiant() {
void testDisplayGiant() {
final var view = new GiantView();
final var model = mock(GiantModel.class);