aboutsummaryrefslogtreecommitdiff
path: root/ufund-api/src/test/java/com/ufund/api/ufundapi/persistence/UserAuthFileDAOTest.java
diff options
context:
space:
mode:
authorbenal01 <bja4245@rit.edu>2025-04-01 09:34:36 -0400
committerbenal01 <bja4245@rit.edu>2025-04-01 09:34:36 -0400
commit7ed26c5ee7171a502f6f8527fc55de2bb77eab3b (patch)
tree2046e58c146097aac21c9e352771420c31df6589 /ufund-api/src/test/java/com/ufund/api/ufundapi/persistence/UserAuthFileDAOTest.java
parentef46ddd082bb91d0262363536d46fe3eb4da47be (diff)
parentd8330f1ac85b26d08ca4df5ce3875078d7b4f47f (diff)
downloadJellySolutions-7ed26c5ee7171a502f6f8527fc55de2bb77eab3b.tar.gz
JellySolutions-7ed26c5ee7171a502f6f8527fc55de2bb77eab3b.tar.bz2
JellySolutions-7ed26c5ee7171a502f6f8527fc55de2bb77eab3b.zip
Merge branch 'main' of https://github.com/RIT-SWEN-261-02/team-project-2245-swen-261-02-2b-jellysolutions
Diffstat (limited to 'ufund-api/src/test/java/com/ufund/api/ufundapi/persistence/UserAuthFileDAOTest.java')
-rw-r--r--ufund-api/src/test/java/com/ufund/api/ufundapi/persistence/UserAuthFileDAOTest.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/ufund-api/src/test/java/com/ufund/api/ufundapi/persistence/UserAuthFileDAOTest.java b/ufund-api/src/test/java/com/ufund/api/ufundapi/persistence/UserAuthFileDAOTest.java
index f7db747..a4842c5 100644
--- a/ufund-api/src/test/java/com/ufund/api/ufundapi/persistence/UserAuthFileDAOTest.java
+++ b/ufund-api/src/test/java/com/ufund/api/ufundapi/persistence/UserAuthFileDAOTest.java
@@ -2,6 +2,7 @@ package com.ufund.api.ufundapi.persistence;
import java.io.File;
import java.io.IOException;
+import java.time.LocalDateTime;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -18,22 +19,21 @@ import com.ufund.api.ufundapi.model.UserAuth;
public class UserAuthFileDAOTest {
private UserAuthFIleDAO userAuthFIleDAO;
- private ObjectMapper mockObjectMapper;
private UserAuth[] userAuths;
@BeforeEach
public void setupUserAuthFileDAO() throws IOException {
- mockObjectMapper = mock(ObjectMapper.class);
+ ObjectMapper mockObjectMapper = mock(ObjectMapper.class);
userAuths = new UserAuth[]{
- new UserAuth("123", "Phil", null),
- new UserAuth("456", "Bob", null),
- new UserAuth("789", "Steve", null)
+ new UserAuth("123", "Phil", LocalDateTime.MAX),
+ new UserAuth("456", "Bob", LocalDateTime.MAX),
+ new UserAuth("789", "Steve", LocalDateTime.MAX)
};
// When the object mapper is supposed to read from the file
// the mock object mapper will return the hero array above
when(mockObjectMapper
- .readValue(new File("doesnt_matter.txt"),UserAuth[].class))
+ .readValue(new File("doesnt_matter.txt"),UserAuth[].class))
.thenReturn(userAuths);
userAuthFIleDAO = new UserAuthFIleDAO(mockObjectMapper, "doesnt_matter.txt");
}
@@ -43,18 +43,18 @@ public class UserAuthFileDAOTest {
String key = "123";
UserAuth auth = userAuthFIleDAO.getUserAuth(key);
- assertEquals(auth, userAuths[0]);
+ assertEquals(userAuths[0], auth);
}
@Test
- public void addUserAuthTest() throws IOException {
+ public void addUserAuthTest() {
UserAuth auth = new UserAuth("999", "Fish", null);
assertDoesNotThrow(() -> userAuthFIleDAO.addUserAuth(auth));
}
@Test
- public void removeUserAuthTest() throws IOException {
+ public void removeUserAuthTest() {
String key = "123";
assertDoesNotThrow(() -> userAuthFIleDAO.removeUserAuth(key));