FIX:: checkstyle errors (except Cyclomatic Complexity ones)

This commit is contained in:
mlwauben
2019-04-04 08:00:47 +02:00
parent 84154fca3a
commit 82eb5575ee
3 changed files with 17 additions and 11 deletions

View File

@@ -56,7 +56,7 @@ public class Hints {
}
/**
* This method returns a random hint from the list of hints.
* This method gets a random hint from the list of hints.
* @return the random hint.
*/
public String randomHint() {

View File

@@ -77,6 +77,10 @@ public class CalculatorService {
return footprint;
}
/**
* This method adds extra input to the user.
* @param user name of the user
*/
public void addExtras(User user) {
if (user.getExtraInputs().get("local_produce")) {
user.setFootPrint(user.getFootPrint() - 2);

View File

@@ -96,19 +96,21 @@ public class CalculatorServiceTest {
public void addExtrasTest() throws URISyntaxException {
User user = new User(1L,"greenify", "password");
Map<String,Boolean> map = new HashMap<String, Boolean>() {{
put("local_produce", false);
put("bike", false);
put("temperature", false);
put("solar_panels", false);
}};
put("local_produce", false);
put("bike", false);
put("temperature", false);
put("solar_panels", false);
}
};
user.setExtraInputs(map);
user.setFootPrint(50f);
Map<String,Boolean> secondMap = new HashMap<String, Boolean>() {{
put("local_produce", true);
put("bike", true);
put("temperature", true);
put("solar_panels", true);
}};
put("local_produce", true);
put("bike", true);
put("temperature", true);
put("solar_panels", true);
}
};
user.setExtraInputs(secondMap);
calculatorService.addExtras(user);
mockServer.verify();