Polish: assertion arguments should be passed in the correct order,
use assertNull instead of assertEquals(null, value), declare delta as double value in assertEquals
This commit is contained in:
committed by
Juergen Hoeller
parent
39201adca4
commit
0ee505b73e
@@ -92,7 +92,7 @@ public class SpringHandlerInstantiatorTests {
|
||||
public void autowiredDeserializer() throws IOException {
|
||||
String json = "{\"username\":\"bob\"}";
|
||||
User user = this.objectMapper.readValue(json, User.class);
|
||||
assertEquals(user.getUsername(), "BOB");
|
||||
assertEquals("BOB", user.getUsername());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -99,8 +99,8 @@ public class CauchoRemotingTests {
|
||||
assertTrue(factory.getObject() instanceof ITestBean);
|
||||
ITestBean bean = (ITestBean) factory.getObject();
|
||||
|
||||
assertEquals(proxyFactory.user, "test");
|
||||
assertEquals(proxyFactory.password, "bean");
|
||||
assertEquals("test", proxyFactory.user);
|
||||
assertEquals("bean", proxyFactory.password);
|
||||
assertTrue(proxyFactory.overloadEnabled);
|
||||
|
||||
exception.expect(RemoteAccessException.class);
|
||||
|
||||
@@ -62,7 +62,7 @@ public class MappingMediaTypeFileExtensionResolverTests {
|
||||
MappingMediaTypeFileExtensionResolver resolver = new MappingMediaTypeFileExtensionResolver(mapping);
|
||||
MediaType mediaType = resolver.lookupMediaType("JSON");
|
||||
|
||||
assertEquals(mediaType, MediaType.APPLICATION_JSON);
|
||||
assertEquals(MediaType.APPLICATION_JSON, mediaType);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public class WebAsyncManagerTests {
|
||||
fail("Expected exception");
|
||||
}
|
||||
catch (IllegalStateException ex) {
|
||||
assertEquals(ex.getMessage(), "AsyncWebRequest must not be null");
|
||||
assertEquals("AsyncWebRequest must not be null", ex.getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -74,7 +74,7 @@ public class WebAsyncManagerTests {
|
||||
fail("Expected exception");
|
||||
}
|
||||
catch (IllegalStateException ex) {
|
||||
assertEquals(ex.getMessage(), "AsyncWebRequest must not be null");
|
||||
assertEquals("AsyncWebRequest must not be null", ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -256,7 +256,7 @@ public class WebAsyncManagerTests {
|
||||
fail("Expected exception");
|
||||
}
|
||||
catch (IllegalArgumentException ex) {
|
||||
assertEquals(ex.getMessage(), "Callable must not be null");
|
||||
assertEquals("Callable must not be null", ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -357,7 +357,7 @@ public class WebAsyncManagerTests {
|
||||
fail("Expected exception");
|
||||
}
|
||||
catch (IllegalArgumentException ex) {
|
||||
assertEquals(ex.getMessage(), "DeferredResult must not be null");
|
||||
assertEquals("DeferredResult must not be null", ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ public class DelegatingPhaseListenerTests {
|
||||
TestListener target = new TestListener();
|
||||
beanFactory.addBean("testListener", target);
|
||||
|
||||
assertEquals(delPhaseListener.getPhaseId(), PhaseId.ANY_PHASE);
|
||||
assertEquals(PhaseId.ANY_PHASE, delPhaseListener.getPhaseId());
|
||||
PhaseEvent event = new PhaseEvent(facesContext, PhaseId.INVOKE_APPLICATION, new MockLifecycle());
|
||||
|
||||
delPhaseListener.beforePhase(event);
|
||||
@@ -68,7 +68,7 @@ public class DelegatingPhaseListenerTests {
|
||||
beanFactory.addBean("testListener1", target1);
|
||||
beanFactory.addBean("testListener2", target2);
|
||||
|
||||
assertEquals(delPhaseListener.getPhaseId(), PhaseId.ANY_PHASE);
|
||||
assertEquals(PhaseId.ANY_PHASE, delPhaseListener.getPhaseId());
|
||||
PhaseEvent event = new PhaseEvent(facesContext, PhaseId.INVOKE_APPLICATION, new MockLifecycle());
|
||||
|
||||
delPhaseListener.beforePhase(event);
|
||||
|
||||
@@ -42,7 +42,7 @@ public class HtmlUtilsTests {
|
||||
public void testHtmlUnescape() {
|
||||
String escaped = ""This is a quote'";
|
||||
String unescaped = HtmlUtils.htmlUnescape(escaped);
|
||||
assertEquals(unescaped, "\"This is a quote'");
|
||||
assertEquals("\"This is a quote'", unescaped);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -31,7 +31,7 @@ public class ServletContextPropertyUtilsTests {
|
||||
MockServletContext servletContext = new MockServletContext();
|
||||
servletContext.setInitParameter("test.prop", "bar");
|
||||
String resolved = ServletContextPropertyUtils.resolvePlaceholders("${test.prop:foo}", servletContext);
|
||||
assertEquals(resolved, "bar");
|
||||
assertEquals("bar", resolved);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -40,7 +40,7 @@ public class ServletContextPropertyUtilsTests {
|
||||
System.setProperty("test.prop", "bar");
|
||||
try {
|
||||
String resolved = ServletContextPropertyUtils.resolvePlaceholders("${test.prop:foo}", servletContext);
|
||||
assertEquals(resolved, "bar");
|
||||
assertEquals("bar", resolved);
|
||||
}
|
||||
finally {
|
||||
System.clearProperty("test.prop");
|
||||
|
||||
@@ -34,10 +34,10 @@ public class TagUtilsTests {
|
||||
|
||||
@Test
|
||||
public void getScopeSunnyDay() {
|
||||
assertEquals(TagUtils.SCOPE_PAGE, "page");
|
||||
assertEquals(TagUtils.SCOPE_APPLICATION, "application");
|
||||
assertEquals(TagUtils.SCOPE_SESSION, "session");
|
||||
assertEquals(TagUtils.SCOPE_REQUEST, "request");
|
||||
assertEquals("page", TagUtils.SCOPE_PAGE);
|
||||
assertEquals("application", TagUtils.SCOPE_APPLICATION);
|
||||
assertEquals("session", TagUtils.SCOPE_SESSION);
|
||||
assertEquals("request", TagUtils.SCOPE_REQUEST);
|
||||
|
||||
assertEquals(PageContext.PAGE_SCOPE, TagUtils.getScope("page"));
|
||||
assertEquals(PageContext.REQUEST_SCOPE, TagUtils.getScope("request"));
|
||||
|
||||
Reference in New Issue
Block a user