| Total Complexity | 3 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Changes | 5 | ||
| Bugs | 0 | Features | 0 |
| 1 | package com.base.Services; |
||
| 10 | public class UserServiceTest extends AbstractBaseTest { |
||
| 11 | |||
| 12 | /** |
||
| 13 | * Test case for Get User |
||
| 14 | * |
||
| 15 | * @throws UserNotFound |
||
| 16 | */ |
||
| 17 | @Test |
||
| 18 | public void testGetUser() throws UserNotFound { |
||
| 19 | try { |
||
| 20 | User user = base.userService().getUser(String.valueOf(GetUserResponse.VALID_USER_ID)); |
||
| 21 | Assert.assertEquals(user.getName(), GetUserResponse.USER_NAME); |
||
| 22 | Assert.assertEquals(user.getEmail(), GetUserResponse.USER_EMAIL); |
||
| 23 | } catch (UserNotFound e) { |
||
| 24 | Assert.fail(e.getMessage()); |
||
| 25 | } |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Test case for Get User that throws UserNotFound exception. |
||
| 30 | * |
||
| 31 | * @throws UserNotFound |
||
| 32 | */ |
||
| 33 | @Test(expected = UserNotFound.class) |
||
| 34 | public void testGetUserThrowsNotFound() throws UserNotFound { |
||
| 35 | User user = base.userService().getUser("20000"); |
||
| 36 | } |
||
| 38 |