Skip to content

Commit 6313f90

Browse files
committed
test cleanup
1 parent 1dbdc17 commit 6313f90

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

access-control-spring-security/src/test/java/de/dominikschadow/javasecurity/contacts/ContactControllerTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ class ContactControllerTest {
3939
@MockitoBean
4040
private ContactService contactService;
4141

42-
private Contact sampleContact(long id, String username, String firstname, String lastname) {
42+
private Contact sampleContact(long id, String firstname, String lastname) {
4343
Contact c = new Contact();
4444
c.setId(id);
45-
c.setUsername(username);
45+
c.setUsername("userA");
4646
c.setFirstname(firstname);
4747
c.setLastname(lastname);
4848
c.setComment("test");
@@ -53,8 +53,8 @@ private Contact sampleContact(long id, String username, String firstname, String
5353
@WithMockUser(username = "userA")
5454
void listContacts_asUser_ok() throws Exception {
5555
List<Contact> contacts = List.of(
56-
sampleContact(1L, "userA", "Alice", "Anderson"),
57-
sampleContact(2L, "userA", "Alan", "Archer")
56+
sampleContact(1L, "Alice", "Anderson"),
57+
sampleContact(2L, "Alan", "Archer")
5858
);
5959
Mockito.when(contactService.getContacts()).thenReturn(contacts);
6060

@@ -74,7 +74,7 @@ void listContacts_asUser_ok() throws Exception {
7474
@Test
7575
@WithMockUser(username = "userA")
7676
void contactDetails_asUser_ok() throws Exception {
77-
Contact contact = sampleContact(42L, "userA", "Bob", "Baker");
77+
Contact contact = sampleContact(42L, "Bob", "Baker");
7878
Mockito.when(contactService.getContact(42)).thenReturn(contact);
7979

8080
mockMvc.perform(get("/contacts/42"))

0 commit comments

Comments
 (0)