From c60dd5a6eb74f5ee45bb4c83b91746cfc582c47d Mon Sep 17 00:00:00 2001 From: Karl Heinz Marbaise Date: Thu, 18 Aug 2016 17:48:42 +0200 Subject: [PATCH] Fixed #176 HttpResponseException: Not Found (createJob) o Followup and fix the appropriate test to use the correct verifier. --- .../offbytwo/jenkins/FolderManualTests.java | 75 ------------------- .../offbytwo/jenkins/JenkinsServerTest.java | 2 +- 2 files changed, 1 insertion(+), 76 deletions(-) delete mode 100644 jenkins-client/src/test/java/com/offbytwo/jenkins/FolderManualTests.java diff --git a/jenkins-client/src/test/java/com/offbytwo/jenkins/FolderManualTests.java b/jenkins-client/src/test/java/com/offbytwo/jenkins/FolderManualTests.java deleted file mode 100644 index edcbafc7..00000000 --- a/jenkins-client/src/test/java/com/offbytwo/jenkins/FolderManualTests.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.offbytwo.jenkins; - -import java.net.URI; -import java.net.URISyntaxException; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; - -import com.google.common.base.Optional; -import com.offbytwo.jenkins.model.FolderJob; -import com.offbytwo.jenkins.model.Job; -import com.offbytwo.jenkins.model.JobWithDetails; - -public class FolderManualTests { - - private JenkinsServer server; - - @Before - public void SetUp() throws URISyntaxException { - // point this at a local instance of jenkins which has the cloudbees - // folder plugin installed. - server = new JenkinsServer(new URI("http://localhost:8080/")); - } - - @Ignore - @Test - public void testFolderPluginAPIs() throws Exception { - server.createFolder("root"); - JobWithDetails root = server.getJob("root"); - Assert.assertNotNull(root); - - Optional rootFolder = server.getFolderJob(root); - Assert.assertTrue(rootFolder.isPresent()); - - server.createFolder(rootFolder.get(), "subfolder"); - JobWithDetails subfolder = server.getJob(rootFolder.get(), "subfolder"); - Assert.assertNotNull(subfolder); - - Optional subfolderFolder = server.getFolderJob(subfolder); - Assert.assertTrue(subfolderFolder.isPresent()); - - server.deleteJob("root"); - root = server.getJob("root"); - Assert.assertNull(root); - } - - @Ignore - @Test - public void testStuff() { - try { - - String f1 = "test-root"; - String f2 = "test-nested"; - String f3 = "test-double-nested"; - - server.createFolder(f1); - Job job1 = server.getJob(f1); - FolderJob fjob = server.getFolderJob(job1).get(); - server.createFolder(fjob, f2); - - Job job2 = server.getJob(fjob, f2); - FolderJob fjob2 = server.getFolderJob(job2).get(); - server.createFolder(fjob2, f3); - - Job job3 = server.getJob(fjob2, f3); - FolderJob fjob3 = server.getFolderJob(job3).get(); - - JobWithDetails dj = fjob3.details(); - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/jenkins-client/src/test/java/com/offbytwo/jenkins/JenkinsServerTest.java b/jenkins-client/src/test/java/com/offbytwo/jenkins/JenkinsServerTest.java index 2051c5ef..2cb27aa2 100644 --- a/jenkins-client/src/test/java/com/offbytwo/jenkins/JenkinsServerTest.java +++ b/jenkins-client/src/test/java/com/offbytwo/jenkins/JenkinsServerTest.java @@ -219,7 +219,7 @@ public void testCreateJob() throws Exception { // then ArgumentCaptor captureString = ArgumentCaptor.forClass(String.class); - verify(client).post_xml(eq("/createItem?name=" + jobName), captureString.capture(), eq(true)); + verify(client).post_xml(eq("/createItem?name=" + jobName), captureString.capture(), eq(false)); String xmlReturn = captureString.getValue(); assertEquals(xmlReturn, xmlString); }