I think this is a java compiler nuance more than gradle to be honest, but hoping we can configure gradle to do the right thing here(intellij on windows does the right thing somehow??)
I wrote this test and the results per environment are here
- Mac & (Intellij or Eclipse or Gradle) - test passes!!
- Windows & Intellij - test passes
- Windows & gradle - test fails
It took me a while to fine out it was the chinese string that is in the java file itself and then I finally ran into a log in the gradle build as well saying unmappable character (0x8F) for encoding windows-1252.
The error then has lots of incorrect characters. The test case is thus
indent preformatted text by 4 spaces
@Test
public void testChineseText() {
HttpFullRequest req = Requests. createRequest (KnownHttpMethod. GET , “/i18nBasic”);
req.addHeader( new Header(KnownHeaderName. ACCEPT_LANGUAGE , “zh-CN”));
CompletableFuture respFuture = http11Socket.send(req);
ResponseWrapper response = ResponseExtract. waitResponseAndWrap (respFuture);
response.assertStatusCode(KnownStatusCode. HTTP_200_OK );
response.assertContains(“你好, 这个是一个比较长的一个东西 我可以写比较多。 我在北京师范大学学了中文。 我喜欢完冰球”);
response.assertContains(“你好Dean,我们要去Italy”);
}
Gradle 5.3.1
Build time: 2019-03-28 09:09:23 UTC
Revision: f2fae6ba563cfb772c8bc35d31e43c59a5b620c3
Kotlin: 1.3.21
Groovy: 2.5.4
Ant: Apache Ant™ version 1.9.13 compiled on July 10 2018
JVM: 1.8.0_111 (Oracle Corporation 25.111-b14)
OS: Mac OS X 10.14.5 x86_64