[issue - 65] add save test and deleteExceptionBadId test
@@ -30,6 +30,13 @@ public class UserServiceImplTest {
@Autowired
private UserService userService;
+ @Test
+ public void saveTest() {
+ User user = new User();
+ when(userRepo.save(user)).thenReturn(user);
+ assertEquals(user, userService.save(user));
+ }
+
@Test
public void updateUserStatusBlockedTest() {
User user =
@@ -114,4 +121,9 @@ public class UserServiceImplTest {
assertEquals(ROLE.ROLE_ADMIN, userService.getRole("nazarvladykaaa@gmail.com"));
}
+
+ @Test(expected = BadIdException.class)
+ public void deleteByIdExceptionBadIdTest() {
+ userService.deleteById(1l);
+ }
}
