Package hudson.plugins.emailext.plugins.content

Source Code of hudson.plugins.emailext.plugins.content.BuildStatusContentTest

package hudson.plugins.emailext.plugins.content;

import hudson.model.AbstractBuild;
import hudson.util.StreamTaskListener;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

@SuppressWarnings({"unchecked"})
public class BuildStatusContentTest {

    @Test
    public void testGetContent_whenBuildIsBuildingThenStatusShouldBeBuilding()
        throws Exception {
        // Test for HUDSON-953
        AbstractBuild build = mock(AbstractBuild.class);
        when(build.isBuilding()).thenReturn(true);

        String content = new BuildStatusContent().evaluate(build, StreamTaskListener.fromStdout(), BuildStatusContent.MACRO_NAME);

        assertEquals("Building", content);
    }
}
TOP

Related Classes of hudson.plugins.emailext.plugins.content.BuildStatusContentTest

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.