package it.com.atlassian.bitbucket.mesh;

import com.atlassian.bitbucket.mesh.test.cluster.MeshClusterManager;
import org.junit.Test;

import javax.annotation.Resource;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

/**
 * Minimal placeholder test that only verifies that the cluster has been configured and started correctly
 */
public class PlaceholderTest extends AbstractMeshTest {

    @Resource
    private MeshClusterManager meshClusterManager;

    @Test
    public void testClusterInitialized() {
        assertEquals(3, meshClusterManager.getNodes().size());

        meshClusterManager.getNodes().forEach(node -> {
            assertTrue("Node " + node.getUrl() + " is not running", node.isRunning());
            assertTrue("Node " + node.getUrl() + " is not part of the cluster", node.isPartOfCluster());
        });
    }
}
