From ecd7ddadf9fece71c9198eba4ed1c821491f9947 Mon Sep 17 00:00:00 2001 From: Max Curkovic Date: Sat, 4 Nov 2023 08:22:43 -0400 Subject: [PATCH] Quick clean-up, response to Bardia and Tony's reviews --- src/main/java/com/opinionowl/opinionowl/models/AppUser.java | 3 ++- .../opinionowl/opinionowl/models/RadioChoiceQuestion.java | 3 --- .../opinionowl/{SurveyTest.java => IntegrationTest.java} | 5 ++--- 3 files changed, 4 insertions(+), 7 deletions(-) rename src/test/java/com/opinionowl/opinionowl/{SurveyTest.java => IntegrationTest.java} (95%) diff --git a/src/main/java/com/opinionowl/opinionowl/models/AppUser.java b/src/main/java/com/opinionowl/opinionowl/models/AppUser.java index 6500e3b..458f6f2 100644 --- a/src/main/java/com/opinionowl/opinionowl/models/AppUser.java +++ b/src/main/java/com/opinionowl/opinionowl/models/AppUser.java @@ -67,9 +67,10 @@ public boolean removeSurvey (Long surveyId) { @Override public String toString(){ String user = "User ID: " + id + "Username: " + username + "Password: " + password; - user += "\n List of Surveys: "; + user += "\n-----Surveys -----"; for (Survey s: listSurveys) { user += "\n" + s.toString(); + } return user; } diff --git a/src/main/java/com/opinionowl/opinionowl/models/RadioChoiceQuestion.java b/src/main/java/com/opinionowl/opinionowl/models/RadioChoiceQuestion.java index 270f171..4ebe20a 100644 --- a/src/main/java/com/opinionowl/opinionowl/models/RadioChoiceQuestion.java +++ b/src/main/java/com/opinionowl/opinionowl/models/RadioChoiceQuestion.java @@ -4,9 +4,6 @@ import lombok.Getter; import lombok.Setter; -import java.sql.Array; -import java.util.ArrayList; - /** * The class used to describe the multiple choice questions. */ diff --git a/src/test/java/com/opinionowl/opinionowl/SurveyTest.java b/src/test/java/com/opinionowl/opinionowl/IntegrationTest.java similarity index 95% rename from src/test/java/com/opinionowl/opinionowl/SurveyTest.java rename to src/test/java/com/opinionowl/opinionowl/IntegrationTest.java index 31e5f4b..98c8b67 100644 --- a/src/test/java/com/opinionowl/opinionowl/SurveyTest.java +++ b/src/test/java/com/opinionowl/opinionowl/IntegrationTest.java @@ -3,7 +3,6 @@ import com.opinionowl.opinionowl.models.*; import com.opinionowl.opinionowl.repos.SurveyRepository; import com.opinionowl.opinionowl.repos.UserRepository; -import org.h2.engine.User; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; @@ -11,7 +10,7 @@ import java.util.List; @SpringBootTest -public class SurveyTest { +public class IntegrationTest { @Autowired private SurveyRepository surveyRepository; @@ -22,7 +21,7 @@ public class SurveyTest { * Test method for the Survey class. */ @Test - public void testPersist() { + public void testDatabaseIntegration() { AppUser u1 = new AppUser("Test", "123"); Survey survey = new Survey(u1, "TEST_SURVEY"); u1.addSurvey(survey);