1
0
mirror of synced 2026-05-22 21:33:16 +00:00

Start AssertJ Migration

Issue gh-3175
This commit is contained in:
Rob Winch
2015-12-16 10:38:31 -06:00
parent 6cbb439701
commit bb600a473e
355 changed files with 3036 additions and 3133 deletions
@@ -16,7 +16,7 @@
package org.springframework.security.cas.authentication;
import static org.mockito.Mockito.*;
import static org.junit.Assert.*;
import static org.assertj.core.api.Assertions.*;
import org.jasig.cas.client.validation.Assertion;
import org.jasig.cas.client.validation.AssertionImpl;
@@ -90,28 +90,28 @@ public class CasAuthenticationProviderTests {
Authentication result = cap.authenticate(token);
// Confirm ST-123 was NOT added to the cache
assertTrue(cache.getByTicketId("ST-456") == null);
assertThat(cache.getByTicketId("ST-456") == null).isTrue();
if (!(result instanceof CasAuthenticationToken)) {
fail("Should have returned a CasAuthenticationToken");
}
CasAuthenticationToken casResult = (CasAuthenticationToken) result;
assertEquals(makeUserDetailsFromAuthoritiesPopulator(), casResult.getPrincipal());
assertEquals("ST-123", casResult.getCredentials());
assertTrue(casResult.getAuthorities().contains(
new SimpleGrantedAuthority("ROLE_A")));
assertTrue(casResult.getAuthorities().contains(
new SimpleGrantedAuthority("ROLE_B")));
assertEquals(cap.getKey().hashCode(), casResult.getKeyHash());
assertEquals("details", casResult.getDetails());
assertThat(casResult.getPrincipal()).isEqualTo(makeUserDetailsFromAuthoritiesPopulator());
assertThat(casResult.getCredentials()).isEqualTo("ST-123");
assertThat(casResult.getAuthorities()).contains(
new SimpleGrantedAuthority("ROLE_A"));
assertThat(casResult.getAuthorities()).contains(
new SimpleGrantedAuthority("ROLE_B"));
assertThat(casResult.getKeyHash()).isEqualTo(cap.getKey().hashCode());
assertThat(casResult.getDetails()).isEqualTo("details");
// Now confirm the CasAuthenticationToken is automatically re-accepted.
// To ensure TicketValidator not called again, set it to deliver an exception...
cap.setTicketValidator(new MockTicketValidator(false));
Authentication laterResult = cap.authenticate(result);
assertEquals(result, laterResult);
assertThat(laterResult).isEqualTo(result);
}
@Test
@@ -133,15 +133,15 @@ public class CasAuthenticationProviderTests {
Authentication result = cap.authenticate(token);
// Confirm ST-456 was added to the cache
assertTrue(cache.getByTicketId("ST-456") != null);
assertThat(cache.getByTicketId("ST-456") != null).isTrue();
if (!(result instanceof CasAuthenticationToken)) {
fail("Should have returned a CasAuthenticationToken");
}
assertEquals(makeUserDetailsFromAuthoritiesPopulator(), result.getPrincipal());
assertEquals("ST-456", result.getCredentials());
assertEquals("details", result.getDetails());
assertThat(result.getPrincipal()).isEqualTo(makeUserDetailsFromAuthoritiesPopulator());
assertThat(result.getCredentials()).isEqualTo("ST-456");
assertThat(result.getDetails()).isEqualTo("details");
// Now try to authenticate again. To ensure TicketValidator not
// called again, set it to deliver an exception...
@@ -149,8 +149,8 @@ public class CasAuthenticationProviderTests {
// Previously created UsernamePasswordAuthenticationToken is OK
Authentication newResult = cap.authenticate(token);
assertEquals(makeUserDetailsFromAuthoritiesPopulator(), newResult.getPrincipal());
assertEquals("ST-456", newResult.getCredentials());
assertThat(newResult.getPrincipal()).isEqualTo(makeUserDetailsFromAuthoritiesPopulator());
assertThat(newResult.getCredentials()).isEqualTo("ST-456");
}
@Test
@@ -331,10 +331,10 @@ public class CasAuthenticationProviderTests {
cap.afterPropertiesSet();
// TODO disabled because why do we need to expose this?
// assertTrue(cap.getUserDetailsService() != null);
assertEquals("qwerty", cap.getKey());
assertTrue(cap.getStatelessTicketCache() != null);
assertTrue(cap.getTicketValidator() != null);
// assertThat(cap.getUserDetailsService() != null).isTrue();
assertThat(cap.getKey()).isEqualTo("qwerty");
assertThat(cap.getStatelessTicketCache() != null).isTrue();
assertThat(cap.getTicketValidator() != null).isTrue();
}
@Test
@@ -349,10 +349,10 @@ public class CasAuthenticationProviderTests {
TestingAuthenticationToken token = new TestingAuthenticationToken("user",
"password", "ROLE_A");
assertFalse(cap.supports(TestingAuthenticationToken.class));
assertThat(cap.supports(TestingAuthenticationToken.class)).isFalse();
// Try it anyway
assertEquals(null, cap.authenticate(token));
assertThat(cap.authenticate(token)).isEqualTo(null);
}
@Test
@@ -369,14 +369,14 @@ public class CasAuthenticationProviderTests {
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(
"some_normal_user", "password",
AuthorityUtils.createAuthorityList("ROLE_A"));
assertEquals(null, cap.authenticate(token));
assertThat(cap.authenticate(token)).isEqualTo(null);
}
@Test
public void supportsRequiredTokens() {
CasAuthenticationProvider cap = new CasAuthenticationProvider();
assertTrue(cap.supports(UsernamePasswordAuthenticationToken.class));
assertTrue(cap.supports(CasAuthenticationToken.class));
assertThat(cap.supports(UsernamePasswordAuthenticationToken.class)).isTrue();
assertThat(cap.supports(CasAuthenticationToken.class)).isTrue();
}
// ~ Inner Classes
@@ -15,6 +15,8 @@
package org.springframework.security.cas.authentication;
import static org.assertj.core.api.Assertions.*;
import junit.framework.TestCase;
import org.jasig.cas.client.validation.Assertion;
import org.jasig.cas.client.validation.AssertionImpl;
@@ -97,7 +99,6 @@ public class CasAuthenticationTokenTests extends TestCase {
fail("Should have thrown IllegalArgumentException");
}
catch (IllegalArgumentException expected) {
assertTrue(true);
}
}
@@ -110,7 +111,7 @@ public class CasAuthenticationTokenTests extends TestCase {
CasAuthenticationToken token2 = new CasAuthenticationToken("key",
makeUserDetails(), "Password", ROLES, makeUserDetails(), assertion);
assertEquals(token1, token2);
assertThat(token2).isEqualTo(token1);
}
public void testGetters() {
@@ -118,16 +119,15 @@ public class CasAuthenticationTokenTests extends TestCase {
final Assertion assertion = new AssertionImpl("test");
CasAuthenticationToken token = new CasAuthenticationToken("key",
makeUserDetails(), "Password", ROLES, makeUserDetails(), assertion);
assertEquals("key".hashCode(), token.getKeyHash());
assertEquals(makeUserDetails(), token.getPrincipal());
assertEquals("Password", token.getCredentials());
assertTrue(token.getAuthorities()
.contains(new SimpleGrantedAuthority("ROLE_ONE")));
assertTrue(token.getAuthorities()
.contains(new SimpleGrantedAuthority("ROLE_TWO")));
assertEquals(assertion, token.getAssertion());
assertEquals(makeUserDetails().getUsername(), token.getUserDetails()
.getUsername());
assertThat(token.getKeyHash()).isEqualTo("key".hashCode());
assertThat(token.getPrincipal()).isEqualTo(makeUserDetails());
assertThat(token.getCredentials()).isEqualTo("Password");
assertThat(token.getAuthorities())
.contains(new SimpleGrantedAuthority("ROLE_ONE"));
assertThat(token.getAuthorities())
.contains(new SimpleGrantedAuthority("ROLE_TWO"));
assertThat(token.getAssertion()).isEqualTo(assertion);
assertThat(token.getUserDetails().getUsername()).isEqualTo(makeUserDetails().getUsername());
}
public void testNoArgConstructorDoesntExist() {
@@ -136,7 +136,7 @@ public class CasAuthenticationTokenTests extends TestCase {
fail("Should have thrown NoSuchMethodException");
}
catch (NoSuchMethodException expected) {
assertTrue(true);
}
}
@@ -150,7 +150,7 @@ public class CasAuthenticationTokenTests extends TestCase {
makeUserDetails("OTHER_NAME"), "Password", ROLES, makeUserDetails(),
assertion);
assertTrue(!token1.equals(token2));
assertThat(!token1.equals(token2)).isTrue();
}
public void testNotEqualsDueToDifferentAuthenticationClass() {
@@ -161,7 +161,7 @@ public class CasAuthenticationTokenTests extends TestCase {
UsernamePasswordAuthenticationToken token2 = new UsernamePasswordAuthenticationToken(
"Test", "Password", ROLES);
assertTrue(!token1.equals(token2));
assertThat(!token1.equals(token2)).isTrue();
}
public void testNotEqualsDueToKey() {
@@ -173,7 +173,7 @@ public class CasAuthenticationTokenTests extends TestCase {
CasAuthenticationToken token2 = new CasAuthenticationToken("DIFFERENT_KEY",
makeUserDetails(), "Password", ROLES, makeUserDetails(), assertion);
assertTrue(!token1.equals(token2));
assertThat(!token1.equals(token2)).isTrue();
}
public void testNotEqualsDueToAssertion() {
@@ -186,16 +186,16 @@ public class CasAuthenticationTokenTests extends TestCase {
CasAuthenticationToken token2 = new CasAuthenticationToken("key",
makeUserDetails(), "Password", ROLES, makeUserDetails(), assertion2);
assertTrue(!token1.equals(token2));
assertThat(!token1.equals(token2)).isTrue();
}
public void testSetAuthenticated() {
final Assertion assertion = new AssertionImpl("test");
CasAuthenticationToken token = new CasAuthenticationToken("key",
makeUserDetails(), "Password", ROLES, makeUserDetails(), assertion);
assertTrue(token.isAuthenticated());
assertThat(token.isAuthenticated()).isTrue();
token.setAuthenticated(false);
assertTrue(!token.isAuthenticated());
assertThat(!token.isAuthenticated()).isTrue();
}
public void testToString() {
@@ -203,6 +203,6 @@ public class CasAuthenticationTokenTests extends TestCase {
CasAuthenticationToken token = new CasAuthenticationToken("key",
makeUserDetails(), "Password", ROLES, makeUserDetails(), assertion);
String result = token.toString();
assertTrue(result.lastIndexOf("Credentials (Service/Proxy Ticket):") != -1);
assertThat(result.lastIndexOf("Credentials (Service/Proxy Ticket):") != -1).isTrue();
}
}
@@ -25,7 +25,7 @@ import org.junit.AfterClass;
import org.springframework.security.cas.authentication.CasAuthenticationToken;
import org.springframework.security.cas.authentication.EhCacheBasedTicketCache;
import static org.junit.Assert.*;
import static org.assertj.core.api.Assertions.*;
/**
* Tests {@link EhCacheBasedTicketCache}.
@@ -59,15 +59,15 @@ public class EhCacheBasedTicketCacheTests extends AbstractStatelessTicketCacheTe
// Check it gets stored in the cache
cache.putTicketInCache(token);
assertEquals(token, cache.getByTicketId("ST-0-ER94xMJmn6pha35CQRoZ"));
assertThat(cache.getByTicketId("ST-0-ER94xMJmn6pha35CQRoZ")).isEqualTo(token);
// Check it gets removed from the cache
cache.removeTicketFromCache(getToken());
assertNull(cache.getByTicketId("ST-0-ER94xMJmn6pha35CQRoZ"));
assertThat(cache.getByTicketId("ST-0-ER94xMJmn6pha35CQRoZ")).isNull();
// Check it doesn't return values for null or unknown service tickets
assertNull(cache.getByTicketId(null));
assertNull(cache.getByTicketId("UNKNOWN_SERVICE_TICKET"));
assertThat(cache.getByTicketId(null)).isNull();
assertThat(cache.getByTicketId("UNKNOWN_SERVICE_TICKET")).isNull();
}
@Test
@@ -79,11 +79,11 @@ public class EhCacheBasedTicketCacheTests extends AbstractStatelessTicketCacheTe
fail("Should have thrown IllegalArgumentException");
}
catch (IllegalArgumentException expected) {
assertTrue(true);
}
Ehcache myCache = cacheManager.getCache("castickets");
cache.setCache(myCache);
assertEquals(myCache, cache.getCache());
assertThat(cache.getCache()).isEqualTo(myCache);
}
}
@@ -19,7 +19,7 @@ import org.springframework.security.cas.authentication.CasAuthenticationToken;
import org.springframework.security.cas.authentication.NullStatelessTicketCache;
import org.springframework.security.cas.authentication.StatelessTicketCache;
import static org.junit.Assert.*;
import static org.assertj.core.api.Assertions.*;
/**
* Test cases for the @link {@link NullStatelessTicketCache}
@@ -33,14 +33,14 @@ public class NullStatelessTicketCacheTests extends AbstractStatelessTicketCacheT
@Test
public void testGetter() {
assertNull(cache.getByTicketId(null));
assertNull(cache.getByTicketId("test"));
assertThat(cache.getByTicketId(null)).isNull();
assertThat(cache.getByTicketId("test")).isNull();
}
@Test
public void testInsertAndGet() {
final CasAuthenticationToken token = getToken();
cache.putTicketInCache(token);
assertNull(cache.getByTicketId((String) token.getCredentials()));
assertThat(cache.getByTicketId((String) token.getCredentials())).isNull();
}
}
@@ -20,7 +20,7 @@ import org.junit.Test;
import org.springframework.cache.CacheManager;
import org.springframework.cache.concurrent.ConcurrentMapCacheManager;
import static org.junit.Assert.*;
import static org.assertj.core.api.Assertions.*;
/**
* Tests
@@ -50,15 +50,15 @@ public class SpringCacheBasedTicketCacheTests extends AbstractStatelessTicketCac
// Check it gets stored in the cache
cache.putTicketInCache(token);
assertEquals(token, cache.getByTicketId("ST-0-ER94xMJmn6pha35CQRoZ"));
assertThat(cache.getByTicketId("ST-0-ER94xMJmn6pha35CQRoZ")).isEqualTo(token);
// Check it gets removed from the cache
cache.removeTicketFromCache(getToken());
assertNull(cache.getByTicketId("ST-0-ER94xMJmn6pha35CQRoZ"));
assertThat(cache.getByTicketId("ST-0-ER94xMJmn6pha35CQRoZ")).isNull();
// Check it doesn't return values for null or unknown service tickets
assertNull(cache.getByTicketId(null));
assertNull(cache.getByTicketId("UNKNOWN_SERVICE_TICKET"));
assertThat(cache.getByTicketId(null)).isNull();
assertThat(cache.getByTicketId("UNKNOWN_SERVICE_TICKET")).isNull();
}
@Test(expected = IllegalArgumentException.class)
@@ -1,6 +1,7 @@
package org.springframework.security.cas.userdetails;
import static org.junit.Assert.assertTrue;
import static org.assertj.core.api.Assertions.*;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -41,10 +42,10 @@ public class GrantedAuthorityFromAssertionAttributesUserDetailsServiceTests {
assertion, "ticket");
UserDetails user = uds.loadUserDetails(token);
Set<String> roles = AuthorityUtils.authorityListToSet(user.getAuthorities());
assertTrue(roles.size() == 4);
assertTrue(roles.contains("role_a1"));
assertTrue(roles.contains("role_a2"));
assertTrue(roles.contains("role_b"));
assertTrue(roles.contains("role_c"));
assertThat(roles.size()).isEqualTo(4);
assertThat(roles).contains("role_a1");
assertThat(roles).contains("role_a2");
assertThat(roles).contains("role_b");
assertThat(roles).contains("role_c");
}
}
@@ -15,6 +15,8 @@
package org.springframework.security.cas.web;
import static org.assertj.core.api.Assertions.*;
import junit.framework.TestCase;
import org.springframework.mock.web.MockHttpServletRequest;
@@ -42,7 +44,7 @@ public class CasAuthenticationEntryPointTests extends TestCase {
fail("Should have thrown IllegalArgumentException");
}
catch (IllegalArgumentException expected) {
assertEquals("loginUrl must be specified", expected.getMessage());
assertThat(expected.getMessage()).isEqualTo("loginUrl must be specified");
}
}
@@ -55,17 +57,17 @@ public class CasAuthenticationEntryPointTests extends TestCase {
fail("Should have thrown IllegalArgumentException");
}
catch (IllegalArgumentException expected) {
assertEquals("serviceProperties must be specified", expected.getMessage());
assertThat(expected.getMessage()).isEqualTo("serviceProperties must be specified");
}
}
public void testGettersSetters() {
CasAuthenticationEntryPoint ep = new CasAuthenticationEntryPoint();
ep.setLoginUrl("https://cas/login");
assertEquals("https://cas/login", ep.getLoginUrl());
assertThat(ep.getLoginUrl()).isEqualTo("https://cas/login");
ep.setServiceProperties(new ServiceProperties());
assertTrue(ep.getServiceProperties() != null);
assertThat(ep.getServiceProperties() != null).isTrue();
}
public void testNormalOperationWithRenewFalse() throws Exception {
@@ -15,7 +15,7 @@
package org.springframework.security.cas.web;
import static org.junit.Assert.*;
import static org.assertj.core.api.Assertions.*;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.*;
@@ -81,11 +81,11 @@ public class CasAuthenticationFilterTests {
}
});
assertTrue(filter.requiresAuthentication(request, new MockHttpServletResponse()));
assertThat(filter.requiresAuthentication(request, new MockHttpServletResponse())).isTrue();
Authentication result = filter.attemptAuthentication(request,
new MockHttpServletResponse());
assertTrue(result != null);
assertThat(result != null).isTrue();
}
@Test(expected = AuthenticationException.class)
@@ -110,7 +110,7 @@ public class CasAuthenticationFilterTests {
MockHttpServletResponse response = new MockHttpServletResponse();
request.setServletPath(url);
assertTrue(filter.requiresAuthentication(request, response));
assertThat(filter.requiresAuthentication(request, response)).isTrue();
}
@Test
@@ -120,13 +120,13 @@ public class CasAuthenticationFilterTests {
MockHttpServletResponse response = new MockHttpServletResponse();
request.setServletPath("/pgtCallback");
assertFalse(filter.requiresAuthentication(request, response));
assertThat(filter.requiresAuthentication(request, response)).isFalse();
filter.setProxyReceptorUrl(request.getServletPath());
assertFalse(filter.requiresAuthentication(request, response));
assertThat(filter.requiresAuthentication(request, response)).isFalse();
filter.setProxyGrantingTicketStorage(mock(ProxyGrantingTicketStorage.class));
assertTrue(filter.requiresAuthentication(request, response));
assertThat(filter.requiresAuthentication(request, response)).isTrue();
request.setServletPath("/other");
assertFalse(filter.requiresAuthentication(request, response));
assertThat(filter.requiresAuthentication(request, response)).isFalse();
}
@Test
@@ -142,23 +142,23 @@ public class CasAuthenticationFilterTests {
MockHttpServletResponse response = new MockHttpServletResponse();
request.setServletPath(url);
assertTrue(filter.requiresAuthentication(request, response));
assertThat(filter.requiresAuthentication(request, response)).isTrue();
request.setServletPath("/other");
assertFalse(filter.requiresAuthentication(request, response));
assertThat(filter.requiresAuthentication(request, response)).isFalse();
request.setParameter(properties.getArtifactParameter(), "value");
assertTrue(filter.requiresAuthentication(request, response));
assertThat(filter.requiresAuthentication(request, response)).isTrue();
SecurityContextHolder.getContext().setAuthentication(
new AnonymousAuthenticationToken("key", "principal", AuthorityUtils
.createAuthorityList("ROLE_ANONYMOUS")));
assertTrue(filter.requiresAuthentication(request, response));
assertThat(filter.requiresAuthentication(request, response)).isTrue();
SecurityContextHolder.getContext().setAuthentication(
new TestingAuthenticationToken("un", "principal", AuthorityUtils
.createAuthorityList("ROLE_ANONYMOUS")));
assertTrue(filter.requiresAuthentication(request, response));
assertThat(filter.requiresAuthentication(request, response)).isTrue();
SecurityContextHolder.getContext().setAuthentication(
new TestingAuthenticationToken("un", "principal", "ROLE_ANONYMOUS"));
assertFalse(filter.requiresAuthentication(request, response));
assertThat(filter.requiresAuthentication(request, response)).isFalse();
}
@Test
@@ -170,7 +170,7 @@ public class CasAuthenticationFilterTests {
request.setServletPath("/pgtCallback");
filter.setProxyGrantingTicketStorage(mock(ProxyGrantingTicketStorage.class));
filter.setProxyReceptorUrl(request.getServletPath());
assertNull(filter.attemptAuthentication(request, response));
assertThat(filter.attemptAuthentication(request, response)).isNull();
}
@Test
@@ -196,8 +196,8 @@ public class CasAuthenticationFilterTests {
filter.afterPropertiesSet();
filter.doFilter(request, response, chain);
assertFalse("Authentication should not be null", SecurityContextHolder
.getContext().getAuthentication() == null);
assertThat(SecurityContextHolder
.getContext().getAuthentication()).isNotNull().withFailMessage("Authentication should not be null");
verify(chain).doFilter(request, response);
verifyZeroInteractions(successHandler);
@@ -224,4 +224,4 @@ public class CasAuthenticationFilterTests {
filter.doFilter(request, response, chain);
verifyZeroInteractions(chain);
}
}
}
@@ -15,7 +15,7 @@
package org.springframework.security.cas.web;
import static junit.framework.Assert.*;
import static org.assertj.core.api.Assertions.*;
import org.junit.Test;
import org.springframework.security.cas.SamlServiceProperties;
@@ -60,16 +60,16 @@ public class ServicePropertiesTests {
ServiceProperties[] sps = { new ServiceProperties(), new SamlServiceProperties() };
for (ServiceProperties sp : sps) {
sp.setSendRenew(false);
assertFalse(sp.isSendRenew());
assertThat(sp.isSendRenew()).isFalse();
sp.setSendRenew(true);
assertTrue(sp.isSendRenew());
assertThat(sp.isSendRenew()).isTrue();
sp.setArtifactParameter("notticket");
assertEquals("notticket", sp.getArtifactParameter());
assertThat(sp.getArtifactParameter()).isEqualTo("notticket");
sp.setServiceParameter("notservice");
assertEquals("notservice", sp.getServiceParameter());
assertThat(sp.getServiceParameter()).isEqualTo("notservice");
sp.setService("https://mycompany.com/service");
assertEquals("https://mycompany.com/service", sp.getService());
assertThat(sp.getService()).isEqualTo("https://mycompany.com/service");
sp.afterPropertiesSet();
}
@@ -15,7 +15,7 @@
*/
package org.springframework.security.cas.web.authentication;
import static org.junit.Assert.assertEquals;
import static org.assertj.core.api.Assertions.assertThat;
import java.util.regex.Pattern;
@@ -71,7 +71,7 @@ public class DefaultServiceAuthenticationDetailsTests {
public void getServiceUrlNullQuery() throws Exception {
details = new DefaultServiceAuthenticationDetails(casServiceUrl, request,
artifactPattern);
assertEquals(UrlUtils.buildFullRequestUrl(request), details.getServiceUrl());
assertThat(details.getServiceUrl()).isEqualTo(UrlUtils.buildFullRequestUrl(request));
}
@Test
@@ -81,7 +81,7 @@ public class DefaultServiceAuthenticationDetailsTests {
artifactPattern);
String serviceUrl = details.getServiceUrl();
request.setQueryString(null);
assertEquals(UrlUtils.buildFullRequestUrl(request), serviceUrl);
assertThat(serviceUrl).isEqualTo(UrlUtils.buildFullRequestUrl(request));
}
@Test
@@ -91,7 +91,7 @@ public class DefaultServiceAuthenticationDetailsTests {
artifactPattern);
String serviceUrl = details.getServiceUrl();
request.setQueryString("other=value");
assertEquals(UrlUtils.buildFullRequestUrl(request), serviceUrl);
assertThat(serviceUrl).isEqualTo(UrlUtils.buildFullRequestUrl(request));
}
@Test
@@ -101,7 +101,7 @@ public class DefaultServiceAuthenticationDetailsTests {
artifactPattern);
String serviceUrl = details.getServiceUrl();
request.setQueryString("other=value");
assertEquals(UrlUtils.buildFullRequestUrl(request), serviceUrl);
assertThat(serviceUrl).isEqualTo(UrlUtils.buildFullRequestUrl(request));
}
@Test
@@ -111,7 +111,7 @@ public class DefaultServiceAuthenticationDetailsTests {
artifactPattern);
String serviceUrl = details.getServiceUrl();
request.setQueryString("other=value&last=this");
assertEquals(UrlUtils.buildFullRequestUrl(request), serviceUrl);
assertThat(serviceUrl).isEqualTo(UrlUtils.buildFullRequestUrl(request));
}
@Test
@@ -120,7 +120,7 @@ public class DefaultServiceAuthenticationDetailsTests {
request.setServerName("evil.com");
details = new DefaultServiceAuthenticationDetails(casServiceUrl, request,
artifactPattern);
assertEquals("https://example.com/cas-sample/secure/", details.getServiceUrl());
assertThat(details.getServiceUrl()).isEqualTo("https://example.com/cas-sample/secure/");
}
@Test
@@ -128,7 +128,7 @@ public class DefaultServiceAuthenticationDetailsTests {
casServiceUrl = "https://example.com/j_spring_security_cas";
request.setServerName("evil.com");
ServiceAuthenticationDetails details = loadServiceAuthenticationDetails("defaultserviceauthenticationdetails-explicit.xml");
assertEquals("https://example.com/cas-sample/secure/", details.getServiceUrl());
assertThat(details.getServiceUrl()).isEqualTo("https://example.com/cas-sample/secure/");
}
private ServiceAuthenticationDetails loadServiceAuthenticationDetails(