diff --git a/server/src/main/java/umm3601/todo/Todo.java b/server/src/main/java/umm3601/todo/Todo.java index c5144ea..5249cee 100644 --- a/server/src/main/java/umm3601/todo/Todo.java +++ b/server/src/main/java/umm3601/todo/Todo.java @@ -1,7 +1,18 @@ package umm3601.todo; +// Normally you'd want all fields to be private, but +// we need the fields in this class to be public since +// they will be written to by the Jackson library. We +// need to suppress the Visibility Modifier +// (https://checkstyle.sourceforge.io/config_design.html#VisibilityModifier) +// check in CheckStyle so that we don't get a failed +// build when Gradle runs CheckStyle. +@SuppressWarnings({"VisibilityModifier"}) public class Todo { - public String _id; + // By default Java field names shouldn't start with underscores. + // Here, though, we *have* to use the name `_id` to match the + // name of the field in the database. + @SuppressWarnings({"MemberName"}) public String _id; public String owner; public boolean status; public String body; diff --git a/server/src/test/java/umm3601/todo/TodoControllerSpec.java b/server/src/test/java/umm3601/todo/TodoControllerSpec.java index fa7b4ac..e9f13fd 100644 --- a/server/src/test/java/umm3601/todo/TodoControllerSpec.java +++ b/server/src/test/java/umm3601/todo/TodoControllerSpec.java @@ -15,8 +15,6 @@ import io.javalin.http.Context; import umm3601.Main; -import umm3601.user.UserController; -import umm3601.user.UserDatabase; public class TodoControllerSpec { private static TodoDatabase db;