1
0
mirror of synced 2026-08-04 09:17:02 +00:00

Fix JDK 9

Issue: gh-5160
This commit is contained in:
Rob Winch
2018-03-26 20:01:40 -05:00
parent 197439f9e1
commit 6729c39905
22 changed files with 81 additions and 27 deletions
@@ -101,7 +101,7 @@ public class WithSecurityContextTestExcecutionListenerTests {
SqlScriptsTestExecutionListener sql = new SqlScriptsTestExecutionListener();
WithSecurityContextTestExecutionListener security = new WithSecurityContextTestExecutionListener();
List<? extends TestExecutionListener> listeners = Arrays.asList(security, sql);
List<TestExecutionListener> listeners = Arrays.asList(security, sql);
AnnotationAwareOrderComparator.sort(listeners);
@@ -24,6 +24,7 @@ import static org.powermock.api.mockito.PowerMockito.when;
import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.user;
import java.util.Arrays;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
@@ -114,8 +115,8 @@ public class SecurityMockMvcRequestPostProcessorsUserTests {
verify(repository).saveContext(contextCaptor.capture(), eq(request),
any(HttpServletResponse.class));
SecurityContext context = contextCaptor.getValue();
assertThat(context.getAuthentication().getAuthorities()).containsOnly(authority1,
authority2);
assertThat((List<GrantedAuthority>) context.getAuthentication().getAuthorities())
.containsOnly(authority1, authority2);
}
@Test(expected = IllegalArgumentException.class)
@@ -133,12 +134,12 @@ public class SecurityMockMvcRequestPostProcessorsUserTests {
verify(repository).saveContext(contextCaptor.capture(), eq(request),
any(HttpServletResponse.class));
SecurityContext context = contextCaptor.getValue();
assertThat(context.getAuthentication().getAuthorities()).containsOnly(authority1,
authority2);
assertThat((List<GrantedAuthority>) context.getAuthentication().getAuthorities())
.containsOnly(authority1, authority2);
}
private void mockWebTestUtils() {
spy(WebTestUtils.class);
when(WebTestUtils.getSecurityContextRepository(request)).thenReturn(repository);
}
}
}