Polish tests and javadoc
When using AssertJ, it's easy to commit the following error assertThat(some boolean condition) The above actually does nothing. It at least needs to be assertThat(some boolean condition).isTrue() This commit refines some assertions that were missing a verify condition. Also, one Javadoc was just a little bit confusing, so this clarifies it. Issue: gh-6259
This commit is contained in:
@@ -96,8 +96,8 @@ public class SessionManagementConfigurerServlet31Tests {
|
||||
|
||||
springSecurityFilterChain.doFilter(request, response, chain);
|
||||
|
||||
assertThat(!request.getSession().getId().equals(id));
|
||||
assertThat(request.getSession().getAttribute("attribute1").equals("value1"));
|
||||
assertThat(request.getSession().getId()).isNotEqualTo(id);
|
||||
assertThat(request.getSession().getAttribute("attribute1")).isEqualTo("value1");
|
||||
}
|
||||
|
||||
@EnableWebSecurity
|
||||
|
||||
@@ -99,8 +99,8 @@ public class SessionManagementConfigServlet31Tests {
|
||||
springSecurityFilterChain.doFilter(request, response, chain);
|
||||
|
||||
|
||||
assertThat(!request.getSession().getId().equals(id));
|
||||
assertThat(request.getSession().getAttribute("attribute1").equals("value1"));
|
||||
assertThat(request.getSession().getId()).isNotEqualTo(id);
|
||||
assertThat(request.getSession().getAttribute("attribute1")).isEqualTo("value1");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -123,7 +123,7 @@ public class SessionManagementConfigServlet31Tests {
|
||||
|
||||
springSecurityFilterChain.doFilter(request, response, chain);
|
||||
|
||||
assertThat(!request.getSession().getId().equals(id));
|
||||
assertThat(request.getSession().getId()).isNotEqualTo(id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user