Skip to content

Commit 14472fa

Browse files
committed
fix: Update testNonExistingUrl to use not exist classpath resource
Signed-off-by: gongzhongqiang <[email protected]>
1 parent 4fc6edd commit 14472fa

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

document-readers/jsoup-reader/src/test/java/org/springframework/ai/reader/jsoup/JsoupDocumentReaderTests.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@
1616

1717
package org.springframework.ai.reader.jsoup;
1818

19+
import java.io.ByteArrayInputStream;
20+
import java.io.IOException;
1921
import java.util.List;
2022

23+
import static org.mockito.Mockito.*;
2124
import static org.assertj.core.api.Assertions.assertThatThrownBy;
2225
import org.junit.jupiter.api.Disabled;
2326
import org.junit.jupiter.api.Test;
@@ -177,8 +180,8 @@ void testParseBodyFragment() {
177180
}
178181

179182
@Test
180-
void testNonExistingUrl() {
181-
JsoupDocumentReader reader = new JsoupDocumentReader("https://nonexistingurl.com",
183+
void testNonExistingHtmlResource() {
184+
JsoupDocumentReader reader = new JsoupDocumentReader("classpath:/non-existing.html",
182185
JsoupDocumentReaderConfig.builder().build());
183186
assertThatThrownBy(reader::get).isInstanceOf(RuntimeException.class);
184187
}

0 commit comments

Comments
 (0)