Package hudson.plugins.im

Examples of hudson.plugins.im.Sender


        JobProvider jobProvider = mock(JobProvider.class);
        cmd.setJobProvider(jobProvider);
       
        AbstractProject<?, ?> project = mockProject(jobProvider);
       
        Sender sender = new Sender("sender");
       
        cmd.getReply(bot, sender, new String[]{ "build", "project", "5s" });
        verify(project).hasPermission(Item.BUILD);
        verify(project).scheduleBuild(eq(5), Mockito.any(Cause.class));
       
View Full Code Here


        when(project.getProperty(ParametersDefinitionProperty.class)).thenReturn(
                new ParametersDefinitionProperty(
                        new StringParameterDefinition("key", "default value", ""),
                        new BooleanParameterDefinition("key2", false, "")));
       
        Sender sender = new Sender("sender");
        cmd.getReply(bot, sender, new String[]{ "build", "project", "3s", "key=value", "key2=true" });
       
        ArgumentCaptor<ParametersAction> captor = ArgumentCaptor.forClass(ParametersAction.class);
        verify(project).scheduleBuild(anyInt(), any(Cause.class),
                captor.capture());
View Full Code Here

        AbstractProject<?, ?> project = mockProject(jobProvider);
        when(project.isParameterized()).thenReturn(Boolean.TRUE);
        when(project.getProperty(ParametersDefinitionProperty.class)).thenReturn(
                new ParametersDefinitionProperty(new StringParameterDefinition("key", "default value", "")));
       
        Sender sender = new Sender("sender");
        cmd.getReply(bot, sender, new String[]{ "build", "project", "key=value", "unexisting_key=value" });
       
        ArgumentCaptor<ParametersAction> captor = ArgumentCaptor.forClass(ParametersAction.class);
        verify(project).scheduleBuild(anyInt(), any(Cause.class),
                captor.capture());
View Full Code Here

        cmd.setJobProvider(jobProvider);
       
        AbstractProject<?, ?> project = mockProject(jobProvider);
        when(project.isBuildable()).thenReturn(false);
       
        Sender sender = new Sender("sender");
        cmd.getReply(bot, sender, new String[]{"build", "project"});
       
        verify(project, times(0)).scheduleBuild(anyInt(), any(Cause.class));
    }
View Full Code Here

TOP

Related Classes of hudson.plugins.im.Sender

Copyright © 2018 www.massapicom. 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.