Tests: Fix DataAttachmentTests to not use System.lineSeparator
The DataAttachmentsTests used the default line separator for checking JSON syntax and indendation. This is not working anymore due to elastic/elasticsearchelastic/elasticsearch#13816 and thus fails on windows. This commit just uses `\n` everywhere as Elasticsearch does as well. Closes elastic/elasticsearch#728 Original commit: elastic/x-pack-elasticsearch@dce572e272
This commit is contained in:
parent
6862cf6996
commit
ef86ea87f6
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
package org.elasticsearch.watcher.actions.email;
|
||||
|
||||
import org.apache.lucene.util.LuceneTestCase.AwaitsFix;
|
||||
import org.elasticsearch.common.io.Streams;
|
||||
import org.elasticsearch.test.ESTestCase;
|
||||
import org.elasticsearch.watcher.actions.email.service.Attachment;
|
||||
|
@ -22,7 +21,6 @@ import static org.hamcrest.Matchers.is;
|
|||
/**
|
||||
*
|
||||
*/
|
||||
@AwaitsFix(bugUrl = "https://github.com/elastic/x-plugins/issues/728")
|
||||
public class DataAttachmentTests extends ESTestCase {
|
||||
|
||||
@Test
|
||||
|
@ -31,7 +29,7 @@ public class DataAttachmentTests extends ESTestCase {
|
|||
Attachment attachment = DataAttachment.JSON.create(data);
|
||||
InputStream input = attachment.bodyPart().getDataHandler().getInputStream();
|
||||
String content = Streams.copyToString(new InputStreamReader(input, StandardCharsets.UTF_8));
|
||||
assertThat(content, is("{" + System.lineSeparator() + " \"key\" : \"value\"" + System.lineSeparator() + "}"));
|
||||
assertThat(content, is("{\n \"key\" : \"value\"\n}"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue