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.
|
* @return the random hint.
|
||||||
*/
|
*/
|
||||||
public String randomHint() {
|
public String randomHint() {
|
||||||
|
|||||||
@@ -77,6 +77,10 @@ public class CalculatorService {
|
|||||||
return footprint;
|
return footprint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method adds extra input to the user.
|
||||||
|
* @param user name of the user
|
||||||
|
*/
|
||||||
public void addExtras(User user) {
|
public void addExtras(User user) {
|
||||||
if (user.getExtraInputs().get("local_produce")) {
|
if (user.getExtraInputs().get("local_produce")) {
|
||||||
user.setFootPrint(user.getFootPrint() - 2);
|
user.setFootPrint(user.getFootPrint() - 2);
|
||||||
|
|||||||
@@ -96,19 +96,21 @@ public class CalculatorServiceTest {
|
|||||||
public void addExtrasTest() throws URISyntaxException {
|
public void addExtrasTest() throws URISyntaxException {
|
||||||
User user = new User(1L,"greenify", "password");
|
User user = new User(1L,"greenify", "password");
|
||||||
Map<String,Boolean> map = new HashMap<String, Boolean>() {{
|
Map<String,Boolean> map = new HashMap<String, Boolean>() {{
|
||||||
put("local_produce", false);
|
put("local_produce", false);
|
||||||
put("bike", false);
|
put("bike", false);
|
||||||
put("temperature", false);
|
put("temperature", false);
|
||||||
put("solar_panels", false);
|
put("solar_panels", false);
|
||||||
}};
|
}
|
||||||
|
};
|
||||||
user.setExtraInputs(map);
|
user.setExtraInputs(map);
|
||||||
user.setFootPrint(50f);
|
user.setFootPrint(50f);
|
||||||
Map<String,Boolean> secondMap = new HashMap<String, Boolean>() {{
|
Map<String,Boolean> secondMap = new HashMap<String, Boolean>() {{
|
||||||
put("local_produce", true);
|
put("local_produce", true);
|
||||||
put("bike", true);
|
put("bike", true);
|
||||||
put("temperature", true);
|
put("temperature", true);
|
||||||
put("solar_panels", true);
|
put("solar_panels", true);
|
||||||
}};
|
}
|
||||||
|
};
|
||||||
user.setExtraInputs(secondMap);
|
user.setExtraInputs(secondMap);
|
||||||
calculatorService.addExtras(user);
|
calculatorService.addExtras(user);
|
||||||
mockServer.verify();
|
mockServer.verify();
|
||||||
|
|||||||
Reference in New Issue
Block a user