TSK-858: added missing UTF-8 encoding for test file.
This commit is contained in:
parent
4b85c9f9b1
commit
523e0715c1
|
|
@ -8,8 +8,10 @@ import static org.junit.Assert.assertThat;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileWriter;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStreamWriter;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -53,15 +55,21 @@ import pro.taskana.rest.resource.ClassificationSummaryResource;
|
||||||
*/
|
*/
|
||||||
@RunWith(SpringRunner.class)
|
@RunWith(SpringRunner.class)
|
||||||
@SpringBootTest(classes = RestConfiguration.class, webEnvironment = WebEnvironment.RANDOM_PORT, properties = {
|
@SpringBootTest(classes = RestConfiguration.class, webEnvironment = WebEnvironment.RANDOM_PORT, properties = {
|
||||||
"devMode=true"})
|
"devMode=true" })
|
||||||
public class ClassificationDefinitionControllerIntTest {
|
public class ClassificationDefinitionControllerIntTest {
|
||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(ClassificationController.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(ClassificationController.class);
|
||||||
|
|
||||||
String server = "http://127.0.0.1:";
|
String server = "http://127.0.0.1:";
|
||||||
|
|
||||||
RestTemplate template;
|
RestTemplate template;
|
||||||
|
|
||||||
HttpEntity<String> request;
|
HttpEntity<String> request;
|
||||||
|
|
||||||
HttpHeaders headers = new HttpHeaders();
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
|
||||||
ObjectMapper objMapper = new ObjectMapper();
|
ObjectMapper objMapper = new ObjectMapper();
|
||||||
|
|
||||||
@LocalServerPort
|
@LocalServerPort
|
||||||
int port;
|
int port;
|
||||||
|
|
||||||
|
|
@ -360,10 +368,12 @@ public class ClassificationDefinitionControllerIntTest {
|
||||||
Thread.sleep(10);
|
Thread.sleep(10);
|
||||||
LOGGER.debug("Wait for 10 s to give the system a chance to update");
|
LOGGER.debug("Wait for 10 s to give the system a chance to update");
|
||||||
|
|
||||||
ClassificationSummaryResource childWithNewParent = this.getClassificationWithKeyAndDomain("L110105", "DOMAIN_A");
|
ClassificationSummaryResource childWithNewParent = this.getClassificationWithKeyAndDomain("L110105",
|
||||||
|
"DOMAIN_A");
|
||||||
assertEquals(child1.parentKey, childWithNewParent.parentKey);
|
assertEquals(child1.parentKey, childWithNewParent.parentKey);
|
||||||
|
|
||||||
ClassificationSummaryResource childWithoutParent = this.getClassificationWithKeyAndDomain("L110107", "DOMAIN_A");
|
ClassificationSummaryResource childWithoutParent = this.getClassificationWithKeyAndDomain("L110107",
|
||||||
|
"DOMAIN_A");
|
||||||
assertEquals(child2.parentId, childWithoutParent.parentId);
|
assertEquals(child2.parentId, childWithoutParent.parentId);
|
||||||
assertEquals(child2.parentKey, childWithoutParent.parentKey);
|
assertEquals(child2.parentKey, childWithoutParent.parentKey);
|
||||||
}
|
}
|
||||||
|
|
@ -398,7 +408,7 @@ public class ClassificationDefinitionControllerIntTest {
|
||||||
private ResponseEntity<String> importRequest(List<String> clList) throws IOException {
|
private ResponseEntity<String> importRequest(List<String> clList) throws IOException {
|
||||||
LOGGER.debug("Start Import");
|
LOGGER.debug("Start Import");
|
||||||
File tmpFile = File.createTempFile("test", ".tmp");
|
File tmpFile = File.createTempFile("test", ".tmp");
|
||||||
FileWriter writer = new FileWriter(tmpFile);
|
OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(tmpFile), StandardCharsets.UTF_8);
|
||||||
writer.write(clList.toString());
|
writer.write(clList.toString());
|
||||||
writer.close();
|
writer.close();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue