@Test
void content_length_should_be_number_of_bytes() throws IOException {

    // Nice illustration of the problem: https://sankhs.com/2016/03/17/content-length-http-headers/
    // If the content-length header is less than number of bytes, part of the response body thrown away!
    // So if we sent "অhello" with content-length: 6, the client (browser) would only present "অhel".
    // arrange
    String msg = "অ";
    when(demoService.exportDataSet()).thenReturn(msg);
    // act
    ResponseEntity<Resource> responseEntity = controller.exportDataSet();
    // assert
    assertThat(responseEntity.getHeaders().getContentLength()).isEqualTo(3);
}