-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Expand file tree
/
Copy pathRoleTest.java
More file actions
51 lines (40 loc) · 1.29 KB
/
Copy pathRoleTest.java
File metadata and controls
51 lines (40 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package com.visualpathit.account.modelTest;
import org.junit.Assert;
import java.util.HashSet;
import java.util.Set;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import com.visualpathit.account.model.Role;
import com.visualpathit.account.model.User;
/** {@author imrant} !*/
public class RoleTest {
public static final Long EXPECTED_ID = 1L;
public static final String EXPECTED_ROLENAME = "Admin";
public static final int EXPECTED_SIZE = 1;
private Role role;
@Before
public void setUp() throws Exception {
User user = new User();
user.setId(1L);
user.setUsername("Wahidkhan74");
user.setPassword("Wahidkhan74");
user.setUserEmail("XXXXX@gmail.com");
Set<User> users = new HashSet<User>();
users.add(user);
role = new Role();
role.setId(1L);
role.setName("Admin");
role.setUsers(users);
}
@After
public void tearDown() throws Exception {
System.out.println("Test Completed");
}
@Test
public void testUserDetailsHappyFlow() throws Exception {
Assert.assertEquals(EXPECTED_ID, role.getId());
Assert.assertEquals(EXPECTED_ROLENAME, role.getName());
Assert.assertEquals(EXPECTED_SIZE,role.getUsers().size());
}
}