Automate minimesos with jUnit

Step 1 of 4

Create jUnit Test

The following Java snippet the example jUnit test. At the top of the class we define the MesosCluster with Zookeeper and one master and agent.

The test queries for the Cluster state. Based on this it verifies the agent has started, and the master is listening on port 5050.

public class MesosClusterTest {
  public static MesosCluster cluster = new MesosCluster(new ClusterArchitecture.Builder()

  public void mesosClusterCanBeStarted() throws Exception {
    JSONObject stateInfo = cluster.getClusterStateInfo();
    Assert.assertEquals(1, stateInfo.getInt("activated_slaves"));


Copy the snippet into file.