fix(amazon): emit external Amazon URL with region domain (#2330)
This commit is contained in:
@@ -426,6 +426,20 @@ public class AmazonBookParserTest {
|
||||
mockJsoup.verify(() -> Jsoup.connect("https://www.amazon.co.jp/dp/EXAMPLESKU"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void fetchTopMetadata_includesExternalURLWithDomain() throws Exception {
|
||||
mockJsoupConnect("https://www.amazon.de/dp/EXAMPLESKU", readFixture("book-de.html"));
|
||||
when(mockAppSettingService.getAppSettings()).thenReturn(getAppSettings( "de"));
|
||||
|
||||
Book book = getBook("EXAMPLESKU");
|
||||
FetchMetadataRequest fetchMetadataRequest = FetchMetadataRequest.builder().build();
|
||||
|
||||
var metadata = amazonBookParser.fetchTopMetadata(book, fetchMetadataRequest);
|
||||
|
||||
assertThat(metadata).isNotNull();
|
||||
assertThat(metadata.getExternalUrl()).isEqualTo("https://www.amazon.de/dp/EXAMPLESKU");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void fetchTopMetadata_failsWhenDomainIsUnsupported() {
|
||||
when(mockAppSettingService.getAppSettings()).thenReturn(getAppSettings("com@evil.example"));
|
||||
|
||||
Reference in New Issue
Block a user