fix(audible): emit external Audible URL with region domain (#2329)

This commit is contained in:
James Ward
2026-08-12 11:25:01 -04:00
committed by GitHub
parent 536f6af142
commit 8fa769bfd5
2 changed files with 71 additions and 2 deletions
@@ -149,6 +149,42 @@ public class AudibleParserTest {
assertThat(actual).isNotNull();
}
@Test
public void fetchTopMetadata_includesExternalURLWithDomain() throws Exception {
mockHttpClientResponse(
"https://api.audible.co.jp/1.0/catalog/products/EXAMPLESKU",
200,
readFixture("example-asin-lookup.json")
);
when(mockAppSettingService.getAppSettings()).thenReturn(getAppSettings( "co.jp"));
Book book = getBook("EXAMPLESKU");
FetchMetadataRequest fetchMetadataRequest = FetchMetadataRequest.builder().build();
BookMetadata actual = audibleParser.fetchTopMetadata(book, fetchMetadataRequest);
assertThat(actual).isNotNull();
assertThat(actual.getExternalUrl()).isEqualTo("https://www.audible.co.jp/dp/1705047572");
}
@Test
public void fetchTopMetadata_includesExternalURL() throws Exception {
mockHttpClientResponse(
"https://api.audible.com/1.0/catalog/products/EXAMPLESKU",
200,
readFixture("example-asin-lookup.json")
);
Book book = getBook("EXAMPLESKU");
FetchMetadataRequest fetchMetadataRequest = FetchMetadataRequest.builder().build();
BookMetadata actual = audibleParser.fetchTopMetadata(book, fetchMetadataRequest);
assertThat(actual).isNotNull();
assertThat(actual.getExternalUrl()).isEqualTo("https://www.audible.com/dp/1705047572");
}
@Test
public void fetchTopMetadata_removesExtraWhitespace() throws Exception {
mockHttpClientResponse(