Skip to content

Commit d353c60

Browse files
committed
Remove Jsonp tests
1 parent 0e9b459 commit d353c60

File tree

1 file changed

+0
-43
lines changed

1 file changed

+0
-43
lines changed

jmx-http/src/test/java/io/airlift/jmx/TestMBeanResource.java

-43
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,6 @@ public void testGetMBeans()
9898
assertMBeansResponse(jsonRequest(uriFor("/v1/jmx/mbean")));
9999
}
100100

101-
@Test
102-
public void testGetMBeansJsonp()
103-
throws Exception
104-
{
105-
assertMBeansResponse(jsonpRequest(uriFor("/v1/jmx/mbean")));
106-
}
107-
108101
private void assertMBeansResponse(JsonNode mbeans)
109102
{
110103
List<String> names = new ArrayList<>();
@@ -135,22 +128,6 @@ public void testGetMBean()
135128
}
136129
}
137130

138-
@Test
139-
public void testGetMBeanJsonp()
140-
throws Exception
141-
{
142-
for (String mbeanName : getMBeanNames()) {
143-
URI uri = uriBuilderFrom(uriFor("/v1/jmx/mbean"))
144-
.appendPath(mbeanName)
145-
.build();
146-
JsonNode mbean = jsonpRequest(uri);
147-
148-
JsonNode name = mbean.get("objectName");
149-
assertThat(name.isTextual()).isTrue();
150-
assertThat(name.asText()).isEqualTo(mbeanName);
151-
}
152-
}
153-
154131
private JsonNode jsonRequest(URI uri)
155132
throws IOException
156133
{
@@ -163,26 +140,6 @@ private JsonNode jsonRequest(URI uri)
163140
return new ObjectMapperProvider().get().readTree(response.getBody());
164141
}
165142

166-
private JsonNode jsonpRequest(URI uri)
167-
throws IOException
168-
{
169-
uri = uriBuilderFrom(uri)
170-
.addParameter("jsonp", "test")
171-
.build();
172-
Request request = prepareGet().setUri(uri).build();
173-
StringResponse response = client.execute(request, createStringResponseHandler());
174-
175-
assertThat(response.getStatusCode()).as(response.getBody()).isEqualTo(200);
176-
assertContentType(response, JSON_UTF_8);
177-
178-
String jsonp = response.getBody().trim();
179-
assertThat(jsonp).startsWith("test(");
180-
assertThat(jsonp).endsWith(")");
181-
jsonp = jsonp.substring(5, jsonp.length() - 1);
182-
183-
return new ObjectMapperProvider().get().readTree(jsonp);
184-
}
185-
186143
private URI uriFor(String path)
187144
{
188145
return server.getBaseUrl().resolve(path);

0 commit comments

Comments
 (0)