Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

Commit 1509522

Browse files
ilayaperumalgjvalkeal
authored andcommitted
URLResource path can have version
- Remove assertion on not expecting `version` as part of the URL path - Update test Resolves #2082
1 parent 8bde8c1 commit 1509522

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

spring-cloud-dataflow-registry/src/main/java/org/springframework/cloud/dataflow/registry/support/ResourceUtils.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ public static String getUrlResourceWithoutVersion(UrlResource urlResource) {
5858
String version = getUrlResourceVersion(urlResource);
5959
URI uri = getUri(urlResource);
6060
String theRest = uri.toString().substring(0, uri.toString().indexOf("-" + version));
61-
Assert.isTrue(!theRest.contains(version), "URL resource with version as part of its path is not supported.");
6261
return theRest;
6362
}
6463

spring-cloud-dataflow-registry/src/test/java/org/springframework/cloud/dataflow/registry/support/ResourceUtilsTests.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,10 @@ public void testBadNamedJars() throws Exception {
4040
ResourceUtils.getUrlResourceVersion(urlResource);
4141
}
4242

43-
@Test(expected = IllegalArgumentException.class)
4443
public void testInvalidUrlResourceWithoutVersion() throws Exception {
4544
UrlResource urlResource = new UrlResource("http://repo.spring"
4645
+ ".io/libs-release/org/springframework/cloud/stream/app/file-sink-rabbit/1.2.0.RELEASE/file-sink-rabbit-1.2.0.RELEASE.jar");
47-
ResourceUtils.getUrlResourceWithoutVersion(urlResource);
46+
assertThat(ResourceUtils.getUrlResourceWithoutVersion(urlResource)).isEqualTo("1.2.0.RELEASE");
4847
}
4948

5049
@Test

0 commit comments

Comments
 (0)