Skip to content

Commit 4b2134d

Browse files
committed
TOREE-408: Fix addJar file name test.
URI removes the query fragment from the path component and file name is based on the path. This test used to rely on the fact that the query fragment was included in the file name returned by URL, but this is unreliable. The URL could easily end with some other query param instead of the file name, so the logic wasn't reliable.
1 parent 9dcbc2d commit 4b2134d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel/src/test/scala/org/apache/toree/magic/builtin/AddJarSpec.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ class AddJarSpec extends FunSpec with Matchers with MockitoSugar {
9191

9292
url = """http://www.example.com/remotecontent?filepath=/path/to/someJar.jar"""
9393
jarName = addJarMagic.getFileFromLocation(url)
94-
assert(jarName == "someJar.jar")
94+
// File names come from the path, not from the query fragment
95+
assert(jarName == "remotecontent")
9596

9697
url = """http://www.example.com/"""
9798
jarName = addJarMagic.getFileFromLocation(url)

0 commit comments

Comments
 (0)