Cleanup and additional test

This commit is contained in:
Oleg Zhurakousky
2022-01-24 16:19:26 +01:00
parent 5a36dda7c6
commit f992c448de
2 changed files with 37 additions and 21 deletions

View File

@@ -290,29 +290,11 @@ public class HttpPostIntegrationTests {
@Test
public void uppercaseSSE() throws Exception {
String s = this.rest.exchange(RequestEntity.post(new URI("/uppercase")).contentType(MediaType.APPLICATION_JSON)
.body("[\"foo\",\"bar\"]"), String.class).getBody();
assertThat(this.rest.exchange(RequestEntity.post(new URI("/uppercase")).contentType(MediaType.APPLICATION_JSON)
.body("[\"foo\",\"bar\"]"), String.class).getBody())
.isEqualTo(sse("(FOO)", "(BAR)"));
}
// @Test
// public void uppercaseSSE() throws Exception {
// assertThat(this.rest.exchange(RequestEntity.post(new URI("/uppercase"))
// .accept(EVENT_STREAM).contentType(MediaType.APPLICATION_JSON)
// .body("[\"foo\",\"bar\"]"), String.class).getBody())
// .isEqualTo(sse("(FOO)", "(BAR)"));
//
//// String body = this.rest.exchange(RequestEntity.post(new URI("/uppercase")).contentType(MediaType.APPLICATION_JSON)
//// .body("[\"foo\",\"bar\"]"), String.class).getBody();
//
//// System.out.println(body);
//
//// assertThat(body)
//// .isEqualTo(sse("(FOO)", "(BAR)"));
// }
@Test
public void sum() throws Exception {
@@ -351,7 +333,6 @@ public class HttpPostIntegrationTests {
}
private String sse(String... values) {
//return "data:" + StringUtils.arrayToDelimitedString(values, "\n\ndata:") + "\n\n";
return "[\"" + StringUtils.arrayToDelimitedString(values, "\",\"") + "\"]";
}