Package com.smartcodeltd.jenkinsci.plugins.buildmonitor.viewmodel

Source Code of com.smartcodeltd.jenkinsci.plugins.buildmonitor.viewmodel.BuildViewTest

package com.smartcodeltd.jenkinsci.plugins.buildmonitor.viewmodel;

import com.smartcodeltd.jenkinsci.plugins.buildmonitor.viewmodel.syntacticsugar.BuildStateRecipe;
import hudson.model.AbstractBuild;
import org.junit.Test;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

public class BuildViewTest {

    private static final String theName = "1.5+build.3";

    private BuildViewModel view;


    @Test
    public void should_know_the_name_of_the_job_its_based_on() {
        view = BuildView.of(aBuild(which().nameIs(theName)));

        assertThat(view.name(), is(theName));
        assertThat(view.toString(), is(theName));
    }


    private AbstractBuild<?, ?> aBuild(BuildStateRecipe recipe) {
        return recipe.execute();
    }

    private BuildStateRecipe which() {
        return new BuildStateRecipe();
    }
}
TOP

Related Classes of com.smartcodeltd.jenkinsci.plugins.buildmonitor.viewmodel.BuildViewTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.