Search in sources :

Example 1 with Branch

use of jetbrains.buildServer.server.rest.model.build.Branch in project teamcity-rest by JetBrains.

the class ProjectRequestTest method assertBranchesEquals.

public static void assertBranchesEquals(final List<Branch> branches, Object... values) {
    String actualBranches = getDescription(branches, BRANCH_DESCRIPTION_PROVIDER);
    if (branches == null) {
        if (values.length == 0)
            return;
        fail("Less branches are returned than expected: " + actualBranches);
    }
    Iterator<Branch> branchIt = branches.iterator();
    int i = 0;
    for (Iterator it = Arrays.asList(values).iterator(); it.hasNext(); ) {
        if (!branchIt.hasNext()) {
            fail("Less branches are returned than expected: " + actualBranches);
        }
        Branch branch = branchIt.next();
        assertEquals("Name does not match for branch #" + i + ": " + actualBranches, (String) it.next(), branch.getName());
        assertEquals("isDefault does not match for branch " + branch.getName() + ": " + actualBranches, (Boolean) it.next(), branch.isDefault());
        assertEquals("isUnspecified does not match for branch " + branch.getName() + ": " + actualBranches, (Boolean) it.next(), branch.isUnspecified());
        i++;
    }
    assertFalse("More branches are returned than expected: " + actualBranches, branchIt.hasNext());
}
Also used : Branch(jetbrains.buildServer.server.rest.model.build.Branch)

Aggregations

Branch (jetbrains.buildServer.server.rest.model.build.Branch)1