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:
Alexander Reelsen 2015-10-13 10:49:22 +02:00
parent 6862cf6996
commit ef86ea87f6
1 changed files with 1 additions and 3 deletions

View File

@ -5,7 +5,6 @@
*/ */
package org.elasticsearch.watcher.actions.email; package org.elasticsearch.watcher.actions.email;
import org.apache.lucene.util.LuceneTestCase.AwaitsFix;
import org.elasticsearch.common.io.Streams; import org.elasticsearch.common.io.Streams;
import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.watcher.actions.email.service.Attachment; 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 { public class DataAttachmentTests extends ESTestCase {
@Test @Test
@ -31,7 +29,7 @@ public class DataAttachmentTests extends ESTestCase {
Attachment attachment = DataAttachment.JSON.create(data); Attachment attachment = DataAttachment.JSON.create(data);
InputStream input = attachment.bodyPart().getDataHandler().getInputStream(); InputStream input = attachment.bodyPart().getDataHandler().getInputStream();
String content = Streams.copyToString(new InputStreamReader(input, StandardCharsets.UTF_8)); 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 @Test