Fix JDK 9
Issue: gh-5160
This commit is contained in:
+1
-1
@@ -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);
|
||||
|
||||
|
||||
+6
-5
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user