diff options
author | sowgro <tpoke.ferrari@gmail.com> | 2025-03-25 10:17:55 -0400 |
---|---|---|
committer | sowgro <tpoke.ferrari@gmail.com> | 2025-03-25 10:17:55 -0400 |
commit | 5f03e80712f7a18370b5118fde5327bde1b6fbbf (patch) | |
tree | 17ff94c8ba74ab2bfe6195cb6dc6ca06e71f2ea3 /ufund-api/src/test/java/com/ufund/api/ufundapi/persistence/UserAuthFileDAOTest.java | |
parent | 9aa8a8e80caaad9196752e2e101525a584f35a08 (diff) | |
download | JellySolutions-5f03e80712f7a18370b5118fde5327bde1b6fbbf.tar.gz JellySolutions-5f03e80712f7a18370b5118fde5327bde1b6fbbf.tar.bz2 JellySolutions-5f03e80712f7a18370b5118fde5327bde1b6fbbf.zip |
Fix tests and more cleanup
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.java | 16 |
1 files changed, 8 insertions, 8 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..5e92deb 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"); } @@ -47,14 +47,14 @@ public class UserAuthFileDAOTest { } @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)); |