@@ -44,21 +44,21 @@ public GHOrganizationTest() {
4444 * @throws IOException
4545 * Signals that an I/O exception has occurred.
4646 */
47- @ Before
48- @ After
49- public void cleanUpTeam () throws IOException {
50- // Cleanup is only needed when proxying
51- if (!mockGitHub .isUseProxy ()) {
52- return ;
53- }
47+ @ Before
48+ @ After
49+ public void cleanUpTeam () throws IOException {
50+ // Cleanup is only needed when proxying
51+ if (!mockGitHub .isUseProxy ()) {
52+ return ;
53+ }
5454
55- GHTeam team = getNonRecordingGitHub ().getOrganization (GITHUB_API_TEST_ORG ).getTeamByName (TEAM_NAME_CREATE );
56- if (team != null ) {
57- team .delete ();
58- }
55+ GHTeam team = getNonRecordingGitHub ().getOrganization (GITHUB_API_TEST_ORG ).getTeamByName (TEAM_NAME_CREATE );
56+ if (team != null ) {
57+ team .delete ();
58+ }
5959
60- getNonRecordingGitHub ().getOrganization (GITHUB_API_TEST_ORG ).enableOrganizationProjects (true );
61- }
60+ getNonRecordingGitHub ().getOrganization (GITHUB_API_TEST_ORG ).enableOrganizationProjects (true );
61+ }
6262
6363 /**
6464 * Test are organization projects enabled.
@@ -264,6 +264,37 @@ public void testCreateRepositoryWithTemplateAndGHRepository() throws IOException
264264
265265 }
266266
267+ /**
268+ * Test create a repository from a template with all branches included
269+ *
270+ * @throws IOException
271+ * Signals that an I/O exception has occurred.
272+ * @throws InterruptedException
273+ * Signals that Thread.sleep() was interrupted
274+ */
275+
276+ @ Test
277+ public void testCreateRepositoryWithTemplateAndIncludeAllBranches () throws IOException , InterruptedException {
278+ cleanupRepository (GITHUB_API_TEST_ORG + '/' + GITHUB_API_TEST );
279+
280+ GHOrganization org = gitHub .getOrganization (GITHUB_API_TEST_ORG );
281+ GHRepository templateRepository = org .getRepository (GITHUB_API_TEMPLATE_TEST );
282+
283+ GHRepository repository = gitHub .createRepository (GITHUB_API_TEST )
284+ .fromTemplateRepository (templateRepository )
285+ .includeAllBranches (true )
286+ .owner (GITHUB_API_TEST_ORG )
287+ .create ();
288+
289+ assertThat (repository , notNullValue ());
290+
291+ // give it a moment for branches to be created
292+ Thread .sleep (1500 );
293+
294+ assertThat (repository .getBranches ().keySet (), equalTo (templateRepository .getBranches ().keySet ()));
295+
296+ }
297+
267298 /**
268299 * Test create team.
269300 *
0 commit comments