aboutsummaryrefslogtreecommitdiff
path: root/ufund-api/src/test/java/com/ufund/api/ufundapi/service/UserServiceTest.java
diff options
context:
space:
mode:
authorGunther6070 <haydenhartman10@yahoo.com>2025-04-14 17:37:21 -0400
committerGunther6070 <haydenhartman10@yahoo.com>2025-04-14 17:37:21 -0400
commitfe251b166e6315fdcba8481e5b6b4adfce7885a7 (patch)
treea36a1dfbf96b83e8bba93cec8a28e13d2ab17eef /ufund-api/src/test/java/com/ufund/api/ufundapi/service/UserServiceTest.java
parenta99dac870391305e4b82a3674febda1fe59e5556 (diff)
downloadJellySolutions-fe251b166e6315fdcba8481e5b6b4adfce7885a7.tar.gz
JellySolutions-fe251b166e6315fdcba8481e5b6b4adfce7885a7.tar.bz2
JellySolutions-fe251b166e6315fdcba8481e5b6b4adfce7885a7.zip
Fixed sonarqube issues in tests
Diffstat (limited to 'ufund-api/src/test/java/com/ufund/api/ufundapi/service/UserServiceTest.java')
-rw-r--r--ufund-api/src/test/java/com/ufund/api/ufundapi/service/UserServiceTest.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/ufund-api/src/test/java/com/ufund/api/ufundapi/service/UserServiceTest.java b/ufund-api/src/test/java/com/ufund/api/ufundapi/service/UserServiceTest.java
index 6234416..74f5c63 100644
--- a/ufund-api/src/test/java/com/ufund/api/ufundapi/service/UserServiceTest.java
+++ b/ufund-api/src/test/java/com/ufund/api/ufundapi/service/UserServiceTest.java
@@ -16,21 +16,21 @@ import com.ufund.api.ufundapi.DuplicateKeyException;
import com.ufund.api.ufundapi.model.User;
import com.ufund.api.ufundapi.persistence.UserDAO;
-public class UserServiceTest {
+class UserServiceTest {
private UserService userService;
private UserDAO mockUserDAO;
@BeforeEach
- public void setupUserService() {
+ void setupUserService() {
mockUserDAO = mock(UserDAO.class);
CupboardService mockCupboardService = mock(CupboardService.class);
userService = new UserService(mockUserDAO, mockCupboardService);
}
@Test
- public void testCreateUser() throws IOException, DuplicateKeyException {
+ void testCreateUser() throws IOException, DuplicateKeyException {
// Setup
String username = "Jelly";
String password = "Fish";
@@ -47,7 +47,7 @@ public class UserServiceTest {
}
@Test
- public void testCreateUserDuplicate() throws IOException {
+ void testCreateUserDuplicate() throws IOException {
// Setup
String username = "Jelly";
String password = "Fish";
@@ -62,7 +62,7 @@ public class UserServiceTest {
}
@Test
- public void testGetUser() throws IOException {
+ void testGetUser() throws IOException {
// Setup
String username = "Jelly";
String password = "Fish";
@@ -76,7 +76,7 @@ public class UserServiceTest {
}
@Test
- public void testGetUserBlank() throws IOException {
+ void testGetUserBlank() throws IOException {
// Setup
String username = "Jelly";
String password = "Fish";
@@ -89,7 +89,7 @@ public class UserServiceTest {
assertNull(userService.getUser(username));
}
- @Test public void testGetUserCount() throws IOException {
+ @Test void testGetUserCount() throws IOException {
// Setup
String username = "Jelly";
String password = "Fish";
@@ -105,12 +105,12 @@ public class UserServiceTest {
int userCount = userService.getUserCount();
// Analyze
- assertEquals(userCount, 1);
+ assertEquals(1, userCount);
}
@Test
- public void testUpdateUser() throws IOException {
+ void testUpdateUser() throws IOException {
// Setup
String username = "Jelly";
String password = "Fish";
@@ -128,7 +128,7 @@ public class UserServiceTest {
}
@Test
- public void testUpdateUserDifferentUsernames() throws IOException {
+ void testUpdateUserDifferentUsernames() throws IOException {
// Setup
String username = "Jelly";
String password = "Fish";
@@ -146,7 +146,7 @@ public class UserServiceTest {
}
@Test
- public void testDeleteUser() throws IOException {
+ void testDeleteUser() throws IOException {
// Setup
String username = "Jelly";
String password = "Fish";