Skip to content

Commit 8603857

Browse files
committed
fix: Formatting + use v3 glossary delete in tests
1 parent 852fabe commit 8603857

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

deepl-java/src/main/java/com/deepl/api/DeepLClient.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,8 @@ public MultilingualGlossaryInfo updateMultilingualGlossaryDictionaryFromCsv(
641641
* @throws DeepLException If any error occurs while communicating with the DeepL API, a {@link
642642
* DeepLException} or a derived class will be thrown.
643643
*/
644-
public void deleteMultilingualGlossary(String glossaryId) throws DeepLException, InterruptedException {
644+
public void deleteMultilingualGlossary(String glossaryId)
645+
throws DeepLException, InterruptedException {
645646
String relativeUrl = String.format("/v3/glossaries/%s", glossaryId);
646647
HttpResponse response = httpClientWrapper.sendDeleteRequestWithBackoff(relativeUrl);
647648
this.checkResponse(response, false, true);

deepl-java/src/test/java/com/deepl/api/MultilingualGlossaryCleanupUtility.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,14 @@ public void close() throws Exception {
3434
for (MultilingualGlossaryInfo glossary : glossaries) {
3535
if (Objects.equals(glossary.getName(), glossaryName)) {
3636
try {
37-
// TODO replace with v3 delete glossary
38-
deepLClient.deleteGlossary(glossary.getGlossaryId());
37+
deepLClient.deleteMultilingualGlossary(glossary.getGlossaryId());
3938
} catch (Exception exception) {
4039
// Ignore
40+
System.out.println(
41+
"Failed to delete glossary: "
42+
+ glossaryName
43+
+ "\nException: "
44+
+ exception.getMessage());
4145
}
4246
}
4347
}

0 commit comments

Comments
 (0)