You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by br...@apache.org on 2013/06/25 21:31:59 UTC

svn commit: r1496603 - /commons/proper/chain/trunk/test-utils/src/test/java/org/apache/commons/chain2/testutils/NonDelegatingCommandTestCase.java

Author: britter
Date: Tue Jun 25 19:31:58 2013
New Revision: 1496603

URL: http://svn.apache.org/r1496603
Log:
Make sure NonDelegetingCommand always returns true

Modified:
    commons/proper/chain/trunk/test-utils/src/test/java/org/apache/commons/chain2/testutils/NonDelegatingCommandTestCase.java

Modified: commons/proper/chain/trunk/test-utils/src/test/java/org/apache/commons/chain2/testutils/NonDelegatingCommandTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/test-utils/src/test/java/org/apache/commons/chain2/testutils/NonDelegatingCommandTestCase.java?rev=1496603&r1=1496602&r2=1496603&view=diff
==============================================================================
--- commons/proper/chain/trunk/test-utils/src/test/java/org/apache/commons/chain2/testutils/NonDelegatingCommandTestCase.java (original)
+++ commons/proper/chain/trunk/test-utils/src/test/java/org/apache/commons/chain2/testutils/NonDelegatingCommandTestCase.java Tue Jun 25 19:31:58 2013
@@ -18,12 +18,11 @@
 package org.apache.commons.chain2.testutils;
 
 import static org.apache.commons.chain2.testutils.HasLog.hasLog;
+import static org.hamcrest.Matchers.is;
 import static org.hamcrest.collection.IsCollectionWithSize.hasSize;
 import static org.hamcrest.collection.IsMapContaining.hasKey;
-import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertThat;
 
-import java.util.HashMap;
 import java.util.UUID;
 
 import org.apache.commons.chain2.Context;
@@ -53,7 +52,7 @@ public class NonDelegatingCommandTestCas
 
     @Test
     public void createsLogInEmptyContext() throws Exception {
-        command.execute(context);
+        execute();
 
         assertThat(context.keySet(), hasSize(1));
         assertThat(context, hasKey("log"));
@@ -63,8 +62,12 @@ public class NonDelegatingCommandTestCas
     @Test
     public void existingLogIsReused() throws Exception {
         context.put("log", new StringBuilder("some content"));
-        command.execute(context);
+        execute();
 
         assertThat(context, hasLog("some content/" + ID));
     }
+
+    private void execute() {
+        assertThat(command.execute(context), is(true));
+    }
 }