diff --git a/src/main/java/cz/cvut/kbss/termit/service/IdentifierResolver.java b/src/main/java/cz/cvut/kbss/termit/service/IdentifierResolver.java index 84c62c2c2..ff402eb06 100644 --- a/src/main/java/cz/cvut/kbss/termit/service/IdentifierResolver.java +++ b/src/main/java/cz/cvut/kbss/termit/service/IdentifierResolver.java @@ -169,7 +169,7 @@ public URI generateDerivedIdentifier(URI baseUri, String namespaceSeparator, Str /** * Generates a synthetic identifier using the specified base URL. - * + *

* This particular implementation uses the current system time in millis to generate the locally unique part of the identifier. * * @param base URL base diff --git a/src/test/java/cz/cvut/kbss/termit/rest/TermControllerTest.java b/src/test/java/cz/cvut/kbss/termit/rest/TermControllerTest.java index ac1363d8f..91b462006 100644 --- a/src/test/java/cz/cvut/kbss/termit/rest/TermControllerTest.java +++ b/src/test/java/cz/cvut/kbss/termit/rest/TermControllerTest.java @@ -232,7 +232,7 @@ void getSubTermsLoadsSubTermsOfParentTerm() throws Exception { final MvcResult mvcResult = mockMvc .perform(get(PATH + VOCABULARY_NAME + "/terms/" + TERM_NAME + "/subterms")) .andExpect(status().isOk()).andReturn(); - final List result = readValue(mvcResult, new TypeReference>() { + final List result = readValue(mvcResult, new TypeReference<>() { }); assertEquals(children.size(), result.size()); assertTrue(children.containsAll(result)); @@ -367,13 +367,14 @@ void getAllExportsTermsToExcelWhenAcceptMediaTypeIsExcel() throws Exception { } private TypeAwareByteArrayResource prepareExcel() throws Exception { - final XSSFWorkbook wb = new XSSFWorkbook(); - final XSSFSheet s = wb.createSheet("test"); - s.createRow(0).createCell(0).setCellValue("test"); - final ByteArrayOutputStream bos = new ByteArrayOutputStream(); - wb.write(bos); - return new TypeAwareByteArrayResource(bos.toByteArray(), ExportFormat.EXCEL.getMediaType(), - ExportFormat.EXCEL.getFileExtension()); + try (final XSSFWorkbook wb = new XSSFWorkbook()) { + final XSSFSheet s = wb.createSheet("test"); + s.createRow(0).createCell(0).setCellValue("test"); + final ByteArrayOutputStream bos = new ByteArrayOutputStream(); + wb.write(bos); + return new TypeAwareByteArrayResource(bos.toByteArray(), ExportFormat.EXCEL.getMediaType(), + ExportFormat.EXCEL.getFileExtension()); + } } @Test