continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From batkin...@apache.org
Subject svn commit: r1659092 - in /continuum/trunk/continuum-webapp: ./ src/test/java/org/apache/continuum/web/action/ src/test/java/org/apache/maven/continuum/web/action/
Date Wed, 11 Feb 2015 21:28:09 GMT
Author: batkinson
Date: Wed Feb 11 21:28:08 2015
New Revision: 1659092

URL: http://svn.apache.org/r1659092
Log:
Converted continuum-webapp tests to mockito.

Modified:
    continuum/trunk/continuum-webapp/pom.xml
    continuum/trunk/continuum-webapp/src/test/java/org/apache/continuum/web/action/AbstractActionTest.java
    continuum/trunk/continuum-webapp/src/test/java/org/apache/continuum/web/action/AbstractReleaseActionTest.java
    continuum/trunk/continuum-webapp/src/test/java/org/apache/continuum/web/action/ViewBuildsReportActionTest.java
    continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/AddMavenProjectActionTest.java
    continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/AddProjectActionTest.java
    continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/BuildAgentActionTest.java
    continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/BuildResultActionTest.java
    continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/ProjectGroupActionTest.java
    continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/ReleasePrepareActionTest.java
    continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/SummaryActionTest.java

Modified: continuum/trunk/continuum-webapp/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/pom.xml?rev=1659092&r1=1659091&r2=1659092&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/pom.xml (original)
+++ continuum/trunk/continuum-webapp/pom.xml Wed Feb 11 21:28:08 2015
@@ -688,9 +688,8 @@
       <artifactId>spring-tx</artifactId>
     </dependency>
     <dependency>
-      <groupId>jmock</groupId>
-      <artifactId>jmock</artifactId>
-      <scope>test</scope>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-all</artifactId>
     </dependency>
     <dependency>
       <groupId>javax.mail</groupId>

Modified: continuum/trunk/continuum-webapp/src/test/java/org/apache/continuum/web/action/AbstractActionTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/test/java/org/apache/continuum/web/action/AbstractActionTest.java?rev=1659092&r1=1659091&r2=1659092&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/test/java/org/apache/continuum/web/action/AbstractActionTest.java
(original)
+++ continuum/trunk/continuum-webapp/src/test/java/org/apache/continuum/web/action/AbstractActionTest.java
Wed Feb 11 21:28:08 2015
@@ -25,10 +25,10 @@ import com.opensymphony.xwork2.config.pr
 import com.opensymphony.xwork2.inject.Container;
 import com.opensymphony.xwork2.util.ValueStack;
 import com.opensymphony.xwork2.util.ValueStackFactory;
-import org.jmock.MockObjectTestCase;
+import junit.framework.TestCase;
 
 public abstract class AbstractActionTest
-    extends MockObjectTestCase
+    extends TestCase
 {
     protected void setUp()
         throws Exception

Modified: continuum/trunk/continuum-webapp/src/test/java/org/apache/continuum/web/action/AbstractReleaseActionTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/test/java/org/apache/continuum/web/action/AbstractReleaseActionTest.java?rev=1659092&r1=1659091&r2=1659092&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/test/java/org/apache/continuum/web/action/AbstractReleaseActionTest.java
(original)
+++ continuum/trunk/continuum-webapp/src/test/java/org/apache/continuum/web/action/AbstractReleaseActionTest.java
Wed Feb 11 21:28:08 2015
@@ -26,20 +26,21 @@ import org.apache.continuum.web.action.s
 import org.apache.maven.continuum.Continuum;
 import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.model.system.Profile;
-import org.jmock.Mock;
 
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
+import static org.mockito.Mockito.*;
+
 public class AbstractReleaseActionTest
     extends AbstractActionTest
 {
     private ReleaseActionStub action;
 
-    private Mock continuumMock;
+    private Continuum continuum;
 
-    private Mock configurationServiceMock;
+    private ConfigurationService configurationService;
 
     private String defaultBuildagentUrl = "http://localhost:8181/continuum-buildagent/xmlrpc";
 
@@ -48,8 +49,8 @@ public class AbstractReleaseActionTest
     {
         super.setUp();
 
-        continuumMock = mock( Continuum.class );
-        configurationServiceMock = mock( ConfigurationService.class );
+        continuum = mock( Continuum.class );
+        configurationService = mock( ConfigurationService.class );
 
         Profile profile = new Profile();
         profile.setBuildAgentGroup( "BUILDAGENT_GROUP" );
@@ -57,7 +58,7 @@ public class AbstractReleaseActionTest
         action = new ReleaseActionStub();
         action.setProfile( profile );
         action.setDefaultBuildagent( defaultBuildagentUrl );
-        action.setContinuum( (Continuum) continuumMock.proxy() );
+        action.setContinuum( continuum );
     }
 
     public void testGetEnvironmentsDefaultAgentInGroup()
@@ -67,10 +68,8 @@ public class AbstractReleaseActionTest
         buildAgentGroup.addBuildAgent( new BuildAgentConfiguration( defaultBuildagentUrl,
"Default Build Agent",
                                                                     true ) );
 
-        continuumMock.expects( atLeastOnce() ).method( "getConfiguration" ).will( returnValue(
-            configurationServiceMock.proxy() ) );
-        configurationServiceMock.expects( atLeastOnce() ).method( "getBuildAgentGroup" ).will(
returnValue(
-            buildAgentGroup ) );
+        when( continuum.getConfiguration() ).thenReturn( configurationService );
+        when( configurationService.getBuildAgentGroup( anyString() ) ).thenReturn( buildAgentGroup
);
 
         action.getEnvironments();
         Map<String, String> envVars = action.getEnvironmentVariables();
@@ -85,10 +84,8 @@ public class AbstractReleaseActionTest
     {
         BuildAgentGroupConfiguration buildAgentGroup = createBuildAgentGroupConfiguration(
true );
 
-        continuumMock.expects( atLeastOnce() ).method( "getConfiguration" ).will( returnValue(
-            configurationServiceMock.proxy() ) );
-        configurationServiceMock.expects( atLeastOnce() ).method( "getBuildAgentGroup" ).will(
returnValue(
-            buildAgentGroup ) );
+        when( continuum.getConfiguration() ).thenReturn( configurationService );
+        when( configurationService.getBuildAgentGroup( anyString() ) ).thenReturn( buildAgentGroup
);
 
         action.getEnvironments();
         Map<String, String> envVars = action.getEnvironmentVariables();
@@ -105,10 +102,8 @@ public class AbstractReleaseActionTest
         buildAgentGroup.addBuildAgent( new BuildAgentConfiguration( defaultBuildagentUrl,
"Default Build Agent",
                                                                     false ) );
 
-        continuumMock.expects( atLeastOnce() ).method( "getConfiguration" ).will( returnValue(
-            configurationServiceMock.proxy() ) );
-        configurationServiceMock.expects( atLeastOnce() ).method( "getBuildAgentGroup" ).will(
returnValue(
-            buildAgentGroup ) );
+        when( continuum.getConfiguration() ).thenReturn( configurationService );
+        when( configurationService.getBuildAgentGroup( anyString() ) ).thenReturn( buildAgentGroup
);
 
         action.getEnvironments();
         Map<String, String> envVars = action.getEnvironmentVariables();
@@ -124,10 +119,8 @@ public class AbstractReleaseActionTest
     {
         BuildAgentGroupConfiguration buildAgentGroup = new BuildAgentGroupConfiguration();
 
-        continuumMock.expects( atLeastOnce() ).method( "getConfiguration" ).will( returnValue(
-            configurationServiceMock.proxy() ) );
-        configurationServiceMock.expects( atLeastOnce() ).method( "getBuildAgentGroup" ).will(
returnValue(
-            buildAgentGroup ) );
+        when( continuum.getConfiguration() ).thenReturn( configurationService );
+        when( configurationService.getBuildAgentGroup( anyString() ) ).thenReturn( buildAgentGroup
);
 
         action.getEnvironments();
         Map<String, String> envVars = action.getEnvironmentVariables();

Modified: continuum/trunk/continuum-webapp/src/test/java/org/apache/continuum/web/action/ViewBuildsReportActionTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/test/java/org/apache/continuum/web/action/ViewBuildsReportActionTest.java?rev=1659092&r1=1659091&r2=1659092&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/test/java/org/apache/continuum/web/action/ViewBuildsReportActionTest.java
(original)
+++ continuum/trunk/continuum-webapp/src/test/java/org/apache/continuum/web/action/ViewBuildsReportActionTest.java
Wed Feb 11 21:28:08 2015
@@ -26,18 +26,20 @@ import org.apache.maven.continuum.Contin
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.project.ProjectGroup;
-import org.jmock.Mock;
 
 import java.util.ArrayList;
 import java.util.Calendar;
+import java.util.Date;
 import java.util.List;
 
+import static org.mockito.Mockito.*;
+
 public class ViewBuildsReportActionTest
     extends AbstractActionTest
 {
     private ViewBuildsReportActionStub action;
 
-    private Mock continuum;
+    private Continuum continuum;
 
     private List<BuildResult> buildResults = new ArrayList<BuildResult>();
 
@@ -47,9 +49,10 @@ public class ViewBuildsReportActionTest
     {
         super.setUp();
 
-        action = new ViewBuildsReportActionStub();
         continuum = mock( Continuum.class );
-        action.setContinuum( (Continuum) continuum.proxy() );
+
+        action = new ViewBuildsReportActionStub();
+        action.setContinuum( continuum );
     }
 
     public void testInvalidRowCount()
@@ -60,7 +63,6 @@ public class ViewBuildsReportActionTest
         assertEquals( Action.INPUT, result );
         assertTrue( action.hasFieldErrors() );
         assertFalse( action.hasActionErrors() );
-        continuum.verify();
     }
 
     public void testEndDateBeforeStartDate()
@@ -72,7 +74,6 @@ public class ViewBuildsReportActionTest
         assertEquals( Action.INPUT, result );
         assertTrue( action.hasFieldErrors() );
         assertFalse( action.hasActionErrors() );
-        continuum.verify();
     }
 
     public void testMalformedStartDate()
@@ -83,7 +84,6 @@ public class ViewBuildsReportActionTest
         assertEquals( Action.ERROR, result );
         assertTrue( action.hasActionErrors() );
         assertFalse( action.hasFieldErrors() );
-        continuum.verify();
     }
 
     public void testMalformedEndDate()
@@ -94,29 +94,28 @@ public class ViewBuildsReportActionTest
         assertEquals( Action.ERROR, result );
         assertTrue( action.hasActionErrors() );
         assertFalse( action.hasFieldErrors() );
-        continuum.verify();
     }
 
     public void testStartDateSameWithEndDate()
     {
-        continuum.expects( once() ).method( "getBuildResultsInRange" ).will( returnValue(
buildResults ) );
+        when( continuum.getBuildResultsInRange( anyInt(), any( Date.class ), any( Date.class
), anyInt(),
+                                                anyString() ) ).thenReturn( buildResults
);
 
         action.setStartDate( "04/25/2010" );
         action.setEndDate( "04/25/2010" );
         String result = action.execute();
 
         assertSuccessResult( result );
-        continuum.verify();
     }
 
     public void testEndDateWithNoStartDate()
     {
-        continuum.expects( once() ).method( "getBuildResultsInRange" ).will( returnValue(
buildResults ) );
+        when( continuum.getBuildResultsInRange( anyInt(), any( Date.class ), any( Date.class
), anyInt(),
+                                                anyString() ) ).thenReturn( buildResults
);
         action.setEndDate( "04/25/2010" );
         String result = action.execute();
 
         assertSuccessResult( result );
-        continuum.verify();
     }
 
     public void testExportToCsv()
@@ -127,7 +126,8 @@ public class ViewBuildsReportActionTest
 
         List<BuildResult> results = createBuildResult( cal.getTimeInMillis() );
 
-        continuum.expects( once() ).method( "getBuildResultsInRange" ).will( returnValue(
results ) );
+        when( continuum.getBuildResultsInRange( anyInt(), any( Date.class ), any( Date.class
), anyInt(),
+                                                anyString() ) ).thenReturn( results );
         action.setProjectGroupId( 0 );
         action.setBuildStatus( 0 );
         action.setStartDate( "" );
@@ -138,7 +138,6 @@ public class ViewBuildsReportActionTest
 
         assertEquals( "send-file", result );
         assertFileContentsEqual( IOUtils.toString( action.getInputStream() ), cal.getTime().toString()
);
-        continuum.verify();
     }
 
     private void assertSuccessResult( String result )

Modified: continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/AddMavenProjectActionTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/AddMavenProjectActionTest.java?rev=1659092&r1=1659091&r2=1659092&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/AddMavenProjectActionTest.java
(original)
+++ continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/AddMavenProjectActionTest.java
Wed Feb 11 21:28:08 2015
@@ -24,7 +24,6 @@ import org.apache.continuum.web.action.A
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.builddefinition.BuildDefinitionServiceException;
 import org.apache.maven.continuum.web.action.stub.AddMavenProjectStub;
-import org.jmock.Mock;
 
 import javax.servlet.http.HttpServletRequest;
 import java.io.UnsupportedEncodingException;
@@ -32,6 +31,8 @@ import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLEncoder;
 
+import static org.mockito.Mockito.*;
+
 /**
  * Verifies {@link org.apache.maven.continuum.web.action.AddMavenProjectAction}.
  */
@@ -40,18 +41,17 @@ public class AddMavenProjectActionTest
 {
     private AddMavenProjectStub action;
 
-    private Mock requestMock;
+    private HttpServletRequest request;
 
     public void setUp()
         throws Exception
     {
         super.setUp();
 
-        action = new AddMavenProjectStub();
+        request = mock( HttpServletRequest.class );
 
-        // TODO: upgrade to generics-based mocking
-        requestMock = new Mock( HttpServletRequest.class );
-        action.setServletRequest( (HttpServletRequest) requestMock.proxy() );
+        action = new AddMavenProjectStub();
+        action.setServletRequest( request );
 
     }
 
@@ -71,11 +71,11 @@ public class AddMavenProjectActionTest
         action.setPomUrl( urlToFetch );
         action.setScmUsername( username );
         action.setScmPassword( password );
-        requestMock.expects( once() ).method( "getCharacterEncoding" ).will( returnValue(
encoding ) );
 
-        String result = action.execute();
+        when( request.getCharacterEncoding() ).thenReturn( encoding );
 
-        requestMock.verify();
+        String result = action.execute();
+        
         assertEquals( "action should have succeeded", Action.SUCCESS, result );
 
         URL builtUrl = new URL( action.getPom() );

Modified: continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/AddProjectActionTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/AddProjectActionTest.java?rev=1659092&r1=1659091&r2=1659092&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/AddProjectActionTest.java
(original)
+++ continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/AddProjectActionTest.java
Wed Feb 11 21:28:08 2015
@@ -24,12 +24,13 @@ import org.apache.maven.continuum.Contin
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.project.ProjectGroup;
 import org.apache.maven.continuum.web.action.stub.AddProjectActionStub;
-import org.jmock.Mock;
 
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 
+import static org.mockito.Mockito.*;
+
 /**
  * Test for {@link AddProjectAction}
  *
@@ -40,7 +41,7 @@ public class AddProjectActionTest
 {
     private AddProjectActionStub action;
 
-    private Mock continuumMock;
+    private Continuum continuum;
 
     private static final String VALID_NAME_CHARACTER = "abcABC123whitespaces_.:-";
 
@@ -57,15 +58,20 @@ public class AddProjectActionTest
     {
         super.setUp();
 
+        continuum = mock( Continuum.class );
+
         action = new AddProjectActionStub();
-        continuumMock = new Mock( Continuum.class );
-        action.setContinuum( (Continuum) continuumMock.proxy() );
+        action.setContinuum( continuum );
 
         Collection<ProjectGroup> projectGroups = new ArrayList<ProjectGroup>();
         ProjectGroup projectGroup = new ProjectGroup();
         projectGroups.add( projectGroup );
 
         action.setProjectGroups( projectGroups );
+
+        List<Project> projects = createProjectList();
+        when( continuum.getProjects() ).thenReturn( projects );
+        when( continuum.addProject( any( Project.class ), anyString(), anyInt(), anyInt()
) ).thenReturn( 3 );
     }
 
     public void testAddProjectNullValues()
@@ -88,10 +94,6 @@ public class AddProjectActionTest
     {
         String scmUrl = "scm:svn:http://project/scm/url/test/build.xml";
 
-        List<Project> projects = createProjectList();
-        continuumMock.expects( once() ).method( "getProjects" ).will( returnValue( projects
) );
-        continuumMock.expects( once() ).method( "addProject" ).will( returnValue( 3 ) );
-
         action.setProjectName( "Ant Test Project" );
         action.setProjectVersion( "1.0-SNAPSHOT" );
         action.setProjectScmUrl( scmUrl );
@@ -101,17 +103,11 @@ public class AddProjectActionTest
 
         action.validate();
         action.add();
-        continuumMock.verify();
-
     }
 
     public void testAddAntProjectWithValidValues()
         throws Exception
     {
-        List<Project> projects = createProjectList();
-        continuumMock.expects( once() ).method( "getProjects" ).will( returnValue( projects
) );
-        continuumMock.expects( once() ).method( "addProject" ).will( returnValue( 3 ) );
-
         action.setProjectName( VALID_NAME_CHARACTER );
         action.setProjectDescription( VALID_DESCRIPTION_CHARACTER );
         action.setProjectVersion( VALID_VERSION_CHARACTER );
@@ -130,8 +126,6 @@ public class AddProjectActionTest
 
         // add
         action.add();
-
-        continuumMock.verify();
     }
 
     /**
@@ -144,10 +138,6 @@ public class AddProjectActionTest
     {
         String scmUrl = "scm:svn:http://project/scm/url/test/run.sh";
 
-        List<Project> projects = createProjectList();
-        continuumMock.expects( once() ).method( "getProjects" ).will( returnValue( projects
) );
-        continuumMock.expects( once() ).method( "addProject" ).will( returnValue( 3 ) );
-
         action.setProjectName( "Shell Test Project" );
         action.setProjectVersion( "1.0-SNAPSHOT" );
         action.setProjectScmUrl( scmUrl );
@@ -157,16 +147,11 @@ public class AddProjectActionTest
 
         action.validate();
         action.add();
-        continuumMock.verify();
     }
 
     public void testAddShellProjectWithValidValues()
         throws Exception
     {
-        List<Project> projects = createProjectList();
-        continuumMock.expects( once() ).method( "getProjects" ).will( returnValue( projects
) );
-        continuumMock.expects( once() ).method( "addProject" ).will( returnValue( 3 ) );
-
         action.setProjectName( VALID_NAME_CHARACTER );
         action.setProjectDescription( VALID_DESCRIPTION_CHARACTER );
         action.setProjectVersion( VALID_VERSION_CHARACTER );
@@ -185,8 +170,6 @@ public class AddProjectActionTest
 
         // add
         action.add();
-
-        continuumMock.verify();
     }
 
     private List<Project> createProjectList()

Modified: continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/BuildAgentActionTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/BuildAgentActionTest.java?rev=1659092&r1=1659091&r2=1659092&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/BuildAgentActionTest.java
(original)
+++ continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/BuildAgentActionTest.java
Wed Feb 11 21:28:08 2015
@@ -26,21 +26,22 @@ import org.apache.continuum.web.action.A
 import org.apache.continuum.web.action.admin.BuildAgentAction;
 import org.apache.maven.continuum.Continuum;
 import org.apache.maven.continuum.configuration.ConfigurationService;
-import org.jmock.Mock;
 
 import java.util.ArrayList;
 import java.util.List;
 
+import static org.mockito.Mockito.*;
+
 public class BuildAgentActionTest
     extends AbstractActionTest
 {
     private BuildAgentAction action;
 
-    private Mock continuumMock;
+    private Continuum continuum;
 
-    private Mock configurationServiceMock;
+    private ConfigurationService configurationService;
 
-    private Mock distributedBuildManagerMock;
+    private DistributedBuildManager distributedBuildManager;
 
     private List<BuildAgentConfiguration> buildAgents;
 
@@ -49,12 +50,12 @@ public class BuildAgentActionTest
     {
         super.setUp();
 
-        action = new BuildAgentAction();
-        continuumMock = mock( Continuum.class );
-        configurationServiceMock = mock( ConfigurationService.class );
-        distributedBuildManagerMock = mock( DistributedBuildManager.class );
+        continuum = mock( Continuum.class );
+        configurationService = mock( ConfigurationService.class );
+        distributedBuildManager = mock( DistributedBuildManager.class );
 
-        action.setContinuum( (Continuum) continuumMock.proxy() );
+        action = new BuildAgentAction();
+        action.setContinuum( continuum );
 
         buildAgents = new ArrayList<BuildAgentConfiguration>();
     }
@@ -62,20 +63,18 @@ public class BuildAgentActionTest
     public void testAddBuildAgent()
         throws Exception
     {
-        continuumMock.expects( once() ).method( "getConfiguration" ).will( returnValue(
-            configurationServiceMock.proxy() ) );
-        configurationServiceMock.expects( atLeastOnce() ).method( "getBuildAgents" ).will(
returnValue( buildAgents ) );
-        configurationServiceMock.expects( once() ).method( "addBuildAgent" ).isVoid();
-        configurationServiceMock.expects( once() ).method( "store" ).isVoid();
-        continuumMock.expects( once() ).method( "getDistributedBuildManager" ).will( returnValue(
-            distributedBuildManagerMock.proxy() ) );
-        distributedBuildManagerMock.expects( once() ).method( "update" ).isVoid();
+        when( continuum.getConfiguration() ).thenReturn( configurationService );
+        when( configurationService.getBuildAgents() ).thenReturn( buildAgents );
+        when( continuum.getDistributedBuildManager() ).thenReturn( distributedBuildManager
);
 
         BuildAgentConfiguration buildAgent = new BuildAgentConfiguration();
         buildAgent.setUrl( "http://sample/agent" );
-
         action.setBuildAgent( buildAgent );
         action.save();
+
+        verify( configurationService ).addBuildAgent( any( BuildAgentConfiguration.class
) );
+        verify( configurationService ).store();
+        verify( distributedBuildManager ).update( any( BuildAgentConfiguration.class ) );
     }
 
     public void testDeleteBuildAgent()
@@ -83,19 +82,11 @@ public class BuildAgentActionTest
     {
         List<BuildAgentGroupConfiguration> buildAgentGroups = new ArrayList<BuildAgentGroupConfiguration>();
 
-        continuumMock.expects( atLeastOnce() ).method( "getDistributedBuildManager" ).will(
returnValue(
-            distributedBuildManagerMock.proxy() ) );
-        distributedBuildManagerMock.expects( once() ).method( "isBuildAgentBusy" ).will(
returnValue( false ) );
-        continuumMock.expects( once() ).method( "getConfiguration" ).will( returnValue(
-            configurationServiceMock.proxy() ) );
-        configurationServiceMock.expects( atLeastOnce() ).method( "getBuildAgentGroups" ).will(
returnValue(
-            buildAgentGroups ) );
-        configurationServiceMock.expects( atLeastOnce() ).method( "getBuildAgents" ).will(
returnValue( buildAgents ) );
-
-        distributedBuildManagerMock.expects( never() ).method( "removeDistributedBuildQueueOfAgent"
).isVoid();
-        distributedBuildManagerMock.expects( never() ).method( "reload" ).isVoid();
-        configurationServiceMock.expects( never() ).method( "removeBuildAgent" ).isVoid();
-        configurationServiceMock.expects( never() ).method( "store" ).isVoid();
+        when( continuum.getDistributedBuildManager() ).thenReturn( distributedBuildManager
);
+        when( distributedBuildManager.isBuildAgentBusy( anyString() ) ).thenReturn( false
);
+        when( continuum.getConfiguration() ).thenReturn( configurationService );
+        when( configurationService.getBuildAgentGroups() ).thenReturn( buildAgentGroups );
+        when( configurationService.getBuildAgents() ).thenReturn( buildAgents );
 
         BuildAgentConfiguration buildAgent = new BuildAgentConfiguration();
         buildAgent.setUrl( "http://sample/agent" );
@@ -103,5 +94,10 @@ public class BuildAgentActionTest
         action.setConfirmed( true );
         action.setBuildAgent( buildAgent );
         action.delete();
+
+        verify( distributedBuildManager, never() ).removeDistributedBuildQueueOfAgent( anyString()
);
+        verify( distributedBuildManager, never() ).reload();
+        verify( configurationService, never() ).removeBuildAgent( any( BuildAgentConfiguration.class
) );
+        verify( configurationService, never() ).store();
     }
 }

Modified: continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/BuildResultActionTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/BuildResultActionTest.java?rev=1659092&r1=1659091&r2=1659092&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/BuildResultActionTest.java
(original)
+++ continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/BuildResultActionTest.java
Wed Feb 11 21:28:08 2015
@@ -19,6 +19,7 @@ package org.apache.maven.continuum.web.a
  * under the License.
  */
 
+import com.opensymphony.xwork2.Action;
 import org.apache.continuum.builder.distributed.manager.DistributedBuildManager;
 import org.apache.continuum.buildmanager.BuildsManager;
 import org.apache.continuum.taskqueue.BuildProjectTask;
@@ -29,37 +30,38 @@ import org.apache.maven.continuum.model.
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.web.action.stub.BuildResultActionStub;
 import org.apache.maven.continuum.xmlrpc.project.ContinuumProjectState;
-import org.jmock.Mock;
 
 import java.io.File;
 import java.util.HashMap;
 
+import static org.mockito.Mockito.*;
+
 public class BuildResultActionTest
     extends AbstractActionTest
 {
     private BuildResultActionStub action;
 
-    private Mock continuum;
+    private Continuum continuum;
 
-    private Mock configurationService;
+    private ConfigurationService configurationService;
 
-    private Mock distributedBuildManager;
+    private DistributedBuildManager distributedBuildManager;
 
-    private Mock buildsManager;
+    private BuildsManager buildsManager;
 
     protected void setUp()
         throws Exception
     {
         super.setUp();
 
-        action = new BuildResultActionStub();
         continuum = mock( Continuum.class );
         configurationService = mock( ConfigurationService.class );
         distributedBuildManager = mock( DistributedBuildManager.class );
         buildsManager = mock( BuildsManager.class );
 
-        action.setContinuum( (Continuum) continuum.proxy() );
-        action.setDistributedBuildManager( (DistributedBuildManager) distributedBuildManager.proxy()
);
+        action = new BuildResultActionStub();
+        action.setContinuum( continuum );
+        action.setDistributedBuildManager( distributedBuildManager );
     }
 
     public void testViewPreviousBuild()
@@ -68,22 +70,19 @@ public class BuildResultActionTest
         Project project = createProject( "stub-project" );
         BuildResult buildResult = createBuildResult( project );
 
-        continuum.expects( once() ).method( "getProject" ).will( returnValue( project ) );
-        continuum.expects( once() ).method( "getBuildResult" ).will( returnValue( buildResult
) );
-        continuum.expects( atLeastOnce() ).method( "getConfiguration" ).will( returnValue(
-            (ConfigurationService) configurationService.proxy() ) );
-        configurationService.expects( once() ).method( "isDistributedBuildEnabled" ).will(
returnValue( false ) );
-        configurationService.expects( once() ).method( "getTestReportsDirectory" ).will(
returnValue( new File(
-            "testReportsDir" ) ) );
-        continuum.expects( once() ).method( "getChangesSinceLastSuccess" ).will( returnValue(
null ) );
-        configurationService.expects( once() ).method( "getBuildOutputFile" ).will( returnValue(
new File(
-            "buildOutputFile" ) ) );
-        continuum.expects( once() ).method( "getBuildsManager" ).will( returnValue( buildsManager.proxy()
) );
-        buildsManager.expects( once() ).method( "getCurrentBuilds" ).will( returnValue(
-            new HashMap<String, BuildProjectTask>() ) );
+        when( continuum.getProject( anyInt() ) ).thenReturn( project );
+        when( continuum.getBuildResult( anyInt() ) ).thenReturn( buildResult );
+        when( continuum.getConfiguration() ).thenReturn( configurationService );
+        when( configurationService.isDistributedBuildEnabled() ).thenReturn( false );
+        when( configurationService.getTestReportsDirectory( anyInt(), anyInt() ) ).thenReturn(
+            new File( "testReportsDir" ) );
+        when( continuum.getChangesSinceLastSuccess( anyInt(), anyInt() ) ).thenReturn( null
);
+        when( configurationService.getBuildOutputFile( anyInt(), anyInt() ) ).thenReturn(
+            new File( "buildOutputFile" ) );
+        when( continuum.getBuildsManager() ).thenReturn( buildsManager );
+        when( buildsManager.getCurrentBuilds() ).thenReturn( new HashMap<String, BuildProjectTask>()
);
 
-        action.execute();
-        continuum.verify();
+        assertEquals( Action.SUCCESS, action.execute() );
     }
 
     public void testViewCurrentBuildInDistributedBuildAgent()
@@ -91,15 +90,12 @@ public class BuildResultActionTest
     {
         Project project = createProject( "stub-project" );
 
-        continuum.expects( once() ).method( "getProject" ).will( returnValue( project ) );
-        continuum.expects( once() ).method( "getConfiguration" ).will( returnValue(
-            (ConfigurationService) configurationService.proxy() ) );
-        configurationService.expects( once() ).method( "isDistributedBuildEnabled" ).will(
returnValue( true ) );
-        distributedBuildManager.expects( once() ).method( "getBuildResult" ).will( returnValue(
-            new HashMap<String, Object>() ) );
+        when( continuum.getProject( anyInt() ) ).thenReturn( project );
+        when( continuum.getConfiguration() ).thenReturn( configurationService );
+        when( configurationService.isDistributedBuildEnabled() ).thenReturn( true );
+        when( distributedBuildManager.getBuildResult( anyInt() ) ).thenReturn( new HashMap<String,
Object>() );
 
-        action.execute();
-        continuum.verify();
+        assertEquals( Action.SUCCESS, action.execute() );
     }
 
     private Project createProject( String name )

Modified: continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/ProjectGroupActionTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/ProjectGroupActionTest.java?rev=1659092&r1=1659091&r2=1659092&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/ProjectGroupActionTest.java
(original)
+++ continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/ProjectGroupActionTest.java
Wed Feb 11 21:28:08 2015
@@ -19,6 +19,7 @@ package org.apache.maven.continuum.web.a
  * under the License.
  */
 
+import com.opensymphony.xwork2.Action;
 import org.apache.continuum.web.action.AbstractActionTest;
 import org.apache.maven.continuum.Continuum;
 import org.apache.maven.continuum.model.project.ProjectGroup;
@@ -29,31 +30,32 @@ import org.codehaus.plexus.redback.rbac.
 import org.codehaus.plexus.redback.rbac.UserAssignment;
 import org.codehaus.plexus.redback.rbac.jdo.JdoRole;
 import org.codehaus.plexus.redback.rbac.jdo.JdoUserAssignment;
-import org.jmock.Mock;
 
 import java.util.ArrayList;
 import java.util.List;
 
+import static org.mockito.Mockito.*;
+
 public class ProjectGroupActionTest
     extends AbstractActionTest
 {
     private ProjectGroupActionStub action;
 
-    private Mock continuum;
+    private Continuum continuum;
 
-    private Mock rbac;
+    private RBACManager rbac;
 
     protected void setUp()
         throws Exception
     {
         super.setUp();
 
-        action = new ProjectGroupActionStub();
         continuum = mock( Continuum.class );
         rbac = mock( RBACManager.class );
 
-        action.setContinuum( (Continuum) continuum.proxy() );
-        action.setRbacManager( (RBACManager) rbac.proxy() );
+        action = new ProjectGroupActionStub();
+        action.setContinuum( continuum );
+        action.setRbacManager( rbac );
     }
 
     public void testViewMembersWithProjectAdminRole()
@@ -86,15 +88,12 @@ public class ProjectGroupActionTest
 
         List<Role> eRoles = roles;
 
-        continuum.expects( once() ).method( "getProjectGroupWithProjects" ).will( returnValue(
group ) );
-        rbac.expects( once() ).method( "getAllRoles" ).will( returnValue( roles ) );
-        rbac.expects( once() ).method( "getUserAssignmentsForRoles" ).will( returnValue(
userAssignments ) );
-        rbac.expects( once() ).method( "getEffectivelyAssignedRoles" ).will( returnValue(
eRoles ) );
+        when( continuum.getProjectGroupWithProjects( anyInt() ) ).thenReturn( group );
+        when( rbac.getAllRoles() ).thenReturn( roles );
+        when( rbac.getUserAssignmentsForRoles( anyCollection() ) ).thenReturn( userAssignments
);
+        when( rbac.getEffectivelyAssignedRoles( anyString() ) ).thenReturn( eRoles );
 
-        action.members();
-
-        continuum.verify();
-        rbac.verify();
+        assertEquals( Action.SUCCESS, action.members() );
 
         List<ProjectGroupUserBean> users = action.getProjectGroupUsers();
         assertEquals( 1, users.size() );
@@ -140,15 +139,12 @@ public class ProjectGroupActionTest
         eRoles.add( role2 );
         eRoles.add( role5 );
 
-        continuum.expects( once() ).method( "getProjectGroupWithProjects" ).will( returnValue(
group ) );
-        rbac.expects( once() ).method( "getAllRoles" ).will( returnValue( roles ) );
-        rbac.expects( once() ).method( "getUserAssignmentsForRoles" ).will( returnValue(
userAssignments ) );
-        rbac.expects( once() ).method( "getEffectivelyAssignedRoles" ).will( returnValue(
eRoles ) );
-
-        action.members();
+        when( continuum.getProjectGroupWithProjects( anyInt() ) ).thenReturn( group );
+        when( rbac.getAllRoles() ).thenReturn( roles );
+        when( rbac.getUserAssignmentsForRoles( anyCollection() ) ).thenReturn( userAssignments
);
+        when( rbac.getEffectivelyAssignedRoles( anyString() ) ).thenReturn( eRoles );
 
-        continuum.verify();
-        rbac.verify();
+        assertEquals( Action.SUCCESS, action.members() );
 
         List<ProjectGroupUserBean> users = action.getProjectGroupUsers();
         assertEquals( 1, users.size() );

Modified: continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/ReleasePrepareActionTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/ReleasePrepareActionTest.java?rev=1659092&r1=1659091&r2=1659092&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/ReleasePrepareActionTest.java
(original)
+++ continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/ReleasePrepareActionTest.java
Wed Feb 11 21:28:08 2015
@@ -22,20 +22,20 @@ package org.apache.maven.continuum.web.a
 import org.apache.continuum.web.action.AbstractActionTest;
 import org.apache.maven.continuum.Continuum;
 import org.apache.maven.continuum.model.project.Project;
-import org.jmock.Mock;
+
+import static org.mockito.Mockito.*;
 
 /**
  * Test for {@link ReleasePrepareAction}
  *
  * @author <a href="mailto:carlos@apache.org">Carlos Sanchez</a>
- * @version $Id$
  */
 public class ReleasePrepareActionTest
     extends AbstractActionTest
 {
     private ReleasePrepareAction action;
 
-    private Mock continuumMock;
+    private Continuum continuum;
 
     protected void setUp()
         throws Exception
@@ -43,12 +43,12 @@ public class ReleasePrepareActionTest
         super.setUp();
 
         action = new ReleasePrepareAction();
-        continuumMock = new Mock( Continuum.class );
-        //securitySessionMock = new Mock( SecuritySession.class );
+        continuum = mock( Continuum.class );
+        //securitySessionMock = mock( SecuritySession.class );
         //Map map = new HashMap();
         //map.put( SecuritySystemConstants.SECURITY_SESSION_KEY, securitySessionMock );
         //action.setSession( map );
-        action.setContinuum( (Continuum) continuumMock.proxy() );
+        action.setContinuum( continuum );
     }
 
     /**
@@ -64,14 +64,13 @@ public class ReleasePrepareActionTest
         String svnUrl = "https://svn.apache.org/repos/asf/maven/continuum";
         String scmUrl = "scm:svn:" + svnUrl + "/trunk/";
         //ProjectGroup projectGroup = new ProjectGroup();
-        //continuumMock.expects( once() ).method( "getProjectGroupByProjectId" ).will( returnValue(
projectGroup ) );
+        //continuum.expects( once() ).method( "getProjectGroupByProjectId" ).will( returnValue(
projectGroup ) );
         Project project = new Project();
         project.setScmUrl( scmUrl );
         project.setWorkingDirectory( "." );
-        continuumMock.expects( once() ).method( "getProject" ).will( returnValue( project
) );
-        action.input();
+        when( continuum.getProject( anyInt() ) ).thenReturn( project );
+        action.input(); // expected result?
         assertEquals( svnUrl + "/tags", action.getScmTagBase() );
-        continuumMock.verify();
     }
 
     /**
@@ -87,9 +86,8 @@ public class ReleasePrepareActionTest
         Project project = new Project();
         project.setScmUrl( "scm:cvs:xxx" );
         project.setWorkingDirectory( "." );
-        continuumMock.expects( once() ).method( "getProject" ).will( returnValue( project
) );
-        action.input();
+        when( continuum.getProject( anyInt() ) ).thenReturn( project );
+        action.input(); // expected result?
         assertEquals( "", action.getScmTagBase() );
-        continuumMock.verify();
     }
 }

Modified: continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/SummaryActionTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/SummaryActionTest.java?rev=1659092&r1=1659091&r2=1659092&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/SummaryActionTest.java
(original)
+++ continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/SummaryActionTest.java
Wed Feb 11 21:28:08 2015
@@ -29,7 +29,6 @@ import org.apache.maven.continuum.model.
 import org.apache.maven.continuum.web.action.stub.SummaryActionStub;
 import org.apache.maven.continuum.web.model.ProjectSummary;
 import org.apache.maven.continuum.xmlrpc.project.ContinuumProjectState;
-import org.jmock.Mock;
 
 import java.util.ArrayList;
 import java.util.Collection;
@@ -37,32 +36,31 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import static org.mockito.Mockito.*;
+
 public class SummaryActionTest
     extends AbstractActionTest
 {
     private SummaryActionStub action;
 
-    private Mock continuum;
+    private Continuum continuum;
 
-    private Mock configurationService;
+    private ConfigurationService configurationService;
 
-    private Mock buildsManager;
+    private BuildsManager buildsManager;
 
     protected void setUp()
         throws Exception
     {
         super.setUp();
 
-        action = new SummaryActionStub();
-
         continuum = mock( Continuum.class );
-
         configurationService = mock( ConfigurationService.class );
-
         buildsManager = mock( BuildsManager.class );
 
-        action.setContinuum( (Continuum) continuum.proxy() );
-        action.setParallelBuildsManager( (BuildsManager) buildsManager.proxy() );
+        action = new SummaryActionStub();
+        action.setContinuum( continuum );
+        action.setParallelBuildsManager( buildsManager );
     }
 
     public void testLatestBuildIdWhenCurrentlyBuildingInDistributedBuild()
@@ -72,20 +70,16 @@ public class SummaryActionTest
         Map<Integer, BuildResult> buildResults = createBuildResults( 0, ContinuumProjectState.OK
);
         Map<Integer, BuildResult> buildResultsInSuccess = new HashMap<Integer, BuildResult>();
 
-        continuum.expects( once() ).method( "getProjectsInGroup" ).will( returnValue( projectsInGroup
) );
-        continuum.expects( once() ).method( "getLatestBuildResults" ).will( returnValue(
buildResults ) );
-        continuum.expects( once() ).method( "getBuildResultsInSuccess" ).will( returnValue(
buildResultsInSuccess ) );
-
-        buildsManager.expects( once() ).method( "isInAnyBuildQueue" ).will( returnValue(
false ) );
-        buildsManager.expects( once() ).method( "isInPrepareBuildQueue" ).will( returnValue(
false ) );
-        buildsManager.expects( once() ).method( "isInAnyCheckoutQueue" ).will( returnValue(
false ) );
-
-        continuum.expects( once() ).method( "getConfiguration" ).will( returnValue(
-            (ConfigurationService) configurationService.proxy() ) );
-        configurationService.expects( once() ).method( "isDistributedBuildEnabled" ).will(
returnValue( true ) );
+        when( continuum.getProjectsInGroup( anyInt() ) ).thenReturn( projectsInGroup );
+        when( continuum.getLatestBuildResults( anyInt() ) ).thenReturn( buildResults );
+        when( continuum.getBuildResultsInSuccess( anyInt() ) ).thenReturn( buildResultsInSuccess
);
+        when( buildsManager.isInAnyBuildQueue( anyInt() ) ).thenReturn( false );
+        when( buildsManager.isInPrepareBuildQueue( anyInt() ) ).thenReturn( false );
+        when( buildsManager.isInAnyCheckoutQueue( anyInt() ) ).thenReturn( false );
+        when( continuum.getConfiguration() ).thenReturn( configurationService );
+        when( configurationService.isDistributedBuildEnabled() ).thenReturn( true );
 
-        action.execute();
-        continuum.verify();
+        action.execute(); // expected result?
 
         List<ProjectSummary> projects = action.getProjects();
 
@@ -103,20 +97,16 @@ public class SummaryActionTest
         Map<Integer, BuildResult> buildResults = createBuildResults( 1, ContinuumProjectState.OK
);
         Map<Integer, BuildResult> buildResultsInSuccess = new HashMap<Integer, BuildResult>();
 
-        continuum.expects( once() ).method( "getProjectsInGroup" ).will( returnValue( projectsInGroup
) );
-        continuum.expects( once() ).method( "getLatestBuildResults" ).will( returnValue(
buildResults ) );
-        continuum.expects( once() ).method( "getBuildResultsInSuccess" ).will( returnValue(
buildResultsInSuccess ) );
-
-        buildsManager.expects( once() ).method( "isInAnyBuildQueue" ).will( returnValue(
false ) );
-        buildsManager.expects( once() ).method( "isInPrepareBuildQueue" ).will( returnValue(
false ) );
-        buildsManager.expects( once() ).method( "isInAnyCheckoutQueue" ).will( returnValue(
false ) );
-
-        continuum.expects( once() ).method( "getConfiguration" ).will( returnValue(
-            (ConfigurationService) configurationService.proxy() ) );
-        configurationService.expects( once() ).method( "isDistributedBuildEnabled" ).will(
returnValue( true ) );
+        when( continuum.getProjectsInGroup( anyInt() ) ).thenReturn( projectsInGroup );
+        when( continuum.getLatestBuildResults( anyInt() ) ).thenReturn( buildResults );
+        when( continuum.getBuildResultsInSuccess( anyInt() ) ).thenReturn( buildResultsInSuccess
);
+        when( buildsManager.isInAnyBuildQueue( anyInt() ) ).thenReturn( false );
+        when( buildsManager.isInPrepareBuildQueue( anyInt() ) ).thenReturn( false );
+        when( buildsManager.isInAnyCheckoutQueue( anyInt() ) ).thenReturn( false );
+        when( continuum.getConfiguration() ).thenReturn( configurationService );
+        when( configurationService.isDistributedBuildEnabled() ).thenReturn( true );
 
-        action.execute();
-        continuum.verify();
+        action.execute();  // expected result?
 
         List<ProjectSummary> projects = action.getProjects();
 
@@ -134,20 +124,16 @@ public class SummaryActionTest
         Map<Integer, BuildResult> buildResults = createBuildResults( 1, ContinuumProjectState.BUILDING
);
         Map<Integer, BuildResult> buildResultsInSuccess = new HashMap<Integer, BuildResult>();
 
-        continuum.expects( once() ).method( "getProjectsInGroup" ).will( returnValue( projectsInGroup
) );
-        continuum.expects( once() ).method( "getLatestBuildResults" ).will( returnValue(
buildResults ) );
-        continuum.expects( once() ).method( "getBuildResultsInSuccess" ).will( returnValue(
buildResultsInSuccess ) );
-
-        buildsManager.expects( once() ).method( "isInAnyBuildQueue" ).will( returnValue(
false ) );
-        buildsManager.expects( once() ).method( "isInPrepareBuildQueue" ).will( returnValue(
false ) );
-        buildsManager.expects( once() ).method( "isInAnyCheckoutQueue" ).will( returnValue(
false ) );
-
-        continuum.expects( once() ).method( "getConfiguration" ).will( returnValue(
-            (ConfigurationService) configurationService.proxy() ) );
-        configurationService.expects( once() ).method( "isDistributedBuildEnabled" ).will(
returnValue( false ) );
+        when( continuum.getProjectsInGroup( anyInt() ) ).thenReturn( projectsInGroup );
+        when( continuum.getLatestBuildResults( anyInt() ) ).thenReturn( buildResults );
+        when( continuum.getBuildResultsInSuccess( anyInt() ) ).thenReturn( buildResultsInSuccess
);
+        when( buildsManager.isInAnyBuildQueue( anyInt() ) ).thenReturn( false );
+        when( buildsManager.isInPrepareBuildQueue( anyInt() ) ).thenReturn( false );
+        when( buildsManager.isInAnyCheckoutQueue( anyInt() ) ).thenReturn( false );
+        when( continuum.getConfiguration() ).thenReturn( configurationService );
+        when( configurationService.isDistributedBuildEnabled() ).thenReturn( false );
 
-        action.execute();
-        continuum.verify();
+        action.execute();  // expected result?
 
         List<ProjectSummary> projects = action.getProjects();
 



Mime
View raw message