FIX:: checkstyle errors (except Cyclomatic Complexity ones)
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user