Skip to content

Commit

Permalink
[JENKINS-27607] Reproduced in test.
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick committed Mar 25, 2015
1 parent 9ac2257 commit ac80ef2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/src/test/java/hudson/model/ApiTest.java
Expand Up @@ -29,6 +29,7 @@

import java.io.File;
import java.net.HttpURLConnection;
import org.junit.Ignore;

import org.junit.Rule;
import org.junit.Test;
Expand All @@ -49,6 +50,15 @@ public void xpath() throws Exception {
j.createWebClient().goTo("api/xml?xpath=/*[1]", "application/xml");
}

@Ignore("TODO currently serves application/json")
@Issue("JENKINS-27607")
@Test public void json() throws Exception {
FreeStyleProject p = j.createFreeStyleProject("p");
JenkinsRule.WebClient wc = j.createWebClient();
assertEquals("{\"name\":\"p\"}", wc.goTo(p.getUrl() + "api/json?tree=name", "application/json").getWebResponse().getContentAsString());
assertEquals("wrap({\"name\":\"p\"})", wc.goTo(p.getUrl() + "api/json?tree=name&jsonp=wrap", "application/javascript").getWebResponse().getContentAsString());
}

@Test
@Issue("JENKINS-3267")
public void wrappedZeroItems() throws Exception {
Expand Down

0 comments on commit ac80ef2

Please sign in to comment.