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:
Josh Cummings
2018-12-20 14:53:52 -07:00
parent 086b105273
commit 7a55af246e
4 changed files with 12 additions and 12 deletions

View File

@@ -15,12 +15,14 @@
*/
package org.springframework.security.web.authentication.session;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.modules.junit4.PowerMockRunner;
import org.springframework.mock.web.MockHttpServletRequest;
import static org.assertj.core.api.Assertions.assertThat;
/**
* @author Rob Winch
*
@@ -32,9 +34,7 @@ public class ChangeSessionIdAuthenticationStrategyTests {
public void applySessionFixation() {
MockHttpServletRequest request = new MockHttpServletRequest();
String id = request.getSession().getId();
new ChangeSessionIdAuthenticationStrategy().applySessionFixation(request);
Assert.assertNotEquals(id, request.getSession().getId());
new ChangeSessionIdAuthenticationStrategy().applySessionFixation(request);
assertThat(request.getSession().getId()).isNotEqualTo(id);
}
}