Start AssertJ Migration
Issue gh-3175
This commit is contained in:
+4
-4
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.security.remoting.dns;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.assertj.core.api.Assertions.*;
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
import javax.naming.NameNotFoundException;
|
||||
@@ -57,7 +57,7 @@ public class JndiDnsResolverTests {
|
||||
.thenReturn(records);
|
||||
|
||||
String ipAddress = dnsResolver.resolveIpAddress("www.springsource.com");
|
||||
assertEquals("63.246.7.80", ipAddress);
|
||||
assertThat(ipAddress).isEqualTo("63.246.7.80");
|
||||
}
|
||||
|
||||
@Test(expected = DnsEntryNotFoundException.class)
|
||||
@@ -76,7 +76,7 @@ public class JndiDnsResolverTests {
|
||||
.thenReturn(records);
|
||||
|
||||
String hostname = dnsResolver.resolveServiceEntry("ldap", "springsource.com");
|
||||
assertEquals("kdc.springsource.com", hostname);
|
||||
assertThat(hostname).isEqualTo("kdc.springsource.com");
|
||||
}
|
||||
|
||||
@Test(expected = DnsEntryNotFoundException.class)
|
||||
@@ -98,7 +98,7 @@ public class JndiDnsResolverTests {
|
||||
|
||||
String ipAddress = dnsResolver
|
||||
.resolveServiceIpAddress("ldap", "springsource.com");
|
||||
assertEquals("63.246.7.80", ipAddress);
|
||||
assertThat(ipAddress).isEqualTo("63.246.7.80");
|
||||
}
|
||||
|
||||
@Test(expected = DnsLookupException.class)
|
||||
|
||||
+2
-2
@@ -78,7 +78,7 @@ public class AuthenticationSimpleHttpInvokerRequestExecutorTests extends TestCas
|
||||
executor.prepareConnection(conn, 10);
|
||||
|
||||
// Check connection properties (shouldn't be an Authorization header)
|
||||
assertNull(conn.getRequestProperty("Authorization"));
|
||||
assertThat(conn.getRequestProperty("Authorization")).isNull();
|
||||
}
|
||||
|
||||
// SEC-1975
|
||||
@@ -94,7 +94,7 @@ public class AuthenticationSimpleHttpInvokerRequestExecutorTests extends TestCas
|
||||
executor.prepareConnection(conn, 10);
|
||||
|
||||
// Check connection properties (shouldn't be an Authorization header)
|
||||
assertNull(conn.getRequestProperty("Authorization"));
|
||||
assertThat(conn.getRequestProperty("Authorization")).isNull();
|
||||
}
|
||||
|
||||
// ~ Inner Classes
|
||||
|
||||
+2
-2
@@ -71,7 +71,7 @@ public class ContextPropagatingRemoteInvocationTests extends TestCase {
|
||||
// expected
|
||||
}
|
||||
|
||||
assertNull("Authentication must be null ", SecurityContextHolder.getContext()
|
||||
assertThat(SecurityContextHolder.getContext().as("Authentication must be null ").isNull()
|
||||
.getAuthentication());
|
||||
}
|
||||
|
||||
@@ -112,6 +112,6 @@ public class ContextPropagatingRemoteInvocationTests extends TestCase {
|
||||
SecurityContextHolder.getContext().setAuthentication(clientSideAuthentication);
|
||||
|
||||
ContextPropagatingRemoteInvocation remoteInvocation = getRemoteInvocation();
|
||||
assertEquals(null, ReflectionTestUtils.getField(remoteInvocation, "credentials"));
|
||||
assertThat("credentials")).isEqualTo(null, ReflectionTestUtils.getField(remoteInvocation);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user