File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
src/test/java/org/jenkinsci/plugins/gogs Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ package org .jenkinsci .plugins .gogs ;
2+
3+ import com .cloudbees .hudson .plugins .folder .Folder ;
4+ import hudson .model .FreeStyleProject ;
5+ import hudson .model .Job ;
6+ import org .junit .Rule ;
7+ import org .junit .Test ;
8+ import org .jvnet .hudson .test .JenkinsRule ;
9+ import org .slf4j .Logger ;
10+ import org .slf4j .LoggerFactory ;
11+
12+ import java .io .IOException ;
13+
14+ import static org .junit .Assert .assertEquals ;
15+
16+ /*
17+ * Class to test gogs webhook in cooperation with other plugins
18+ */
19+ public class GogsWebHookPluginsTest {
20+ private final String FOLDERNAME = "testFolder" ;
21+ private final String PROJECTNAME = "testProject" ;
22+
23+ final Logger log = LoggerFactory .getLogger (GogsWebHookPluginsTest .class );
24+
25+ @ Rule
26+ public JenkinsRule r = new JenkinsRule ();
27+
28+ @ Test
29+ public void testCloudBeesFolder () throws Exception {
30+ Folder folder = createFolder (FOLDERNAME );
31+
32+ FreeStyleProject project = folder .createProject (FreeStyleProject .class , PROJECTNAME );
33+
34+ Job job = GogsUtils .find (FOLDERNAME + "/" + PROJECTNAME , Job .class );
35+ assertEquals ("Couldn't find " + FOLDERNAME + "/" + PROJECTNAME , job , project );
36+ }
37+
38+ //
39+ // Helper methods
40+ //
41+ private Folder createFolder (String folder ) throws IOException {
42+ return r .jenkins .createProject (Folder .class , folder );
43+ }
44+
45+ }
You can’t perform that action at this time.
0 commit comments