oscerd closed pull request #180: camel-http4 not recognized automatically URL: https://github.com/apache/camel-k/pull/180
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/pkg/discover/dependencies.go b/pkg/discover/dependencies.go index b6daa63..8e402b2 100644 --- a/pkg/discover/dependencies.go +++ b/pkg/discover/dependencies.go @@ -32,8 +32,8 @@ var ( ) func init() { - singleQuotedURI = regexp.MustCompile("'([a-z-]+):[^']+'") - doubleQuotedURI = regexp.MustCompile("\"([a-z-]+):[^\"]+\"") + singleQuotedURI = regexp.MustCompile("'([a-z0-9-]+):[^']+'") + doubleQuotedURI = regexp.MustCompile("\"([a-z0-9-]+):[^\"]+\"") } // Dependencies returns a list of dependencies required by the given source code diff --git a/pkg/discover/dependencies_test.go b/pkg/discover/dependencies_test.go index 8e48cb1..a7934ef 100644 --- a/pkg/discover/dependencies_test.go +++ b/pkg/discover/dependencies_test.go @@ -84,3 +84,18 @@ func TestDependenciesGroovy(t *testing.T) { // assert all dependencies are found and sorted (removing duplicates) assert.Equal(t, []string{"camel:amqp", "camel:core", "camel:telegram"}, dependencies) } + +func TestDependencies(t *testing.T) { + code := v1alpha1.SourceSpec{ + Name: "Request.java", + Language: v1alpha1.LanguageJavaSource, + Content: ` + from("http4:test").to("log:end"); + from("https4:test").to("log:end"); + from("twitter-timeline:test").to("mock:end"); + `, + } + dependencies := Dependencies(code) + // assert all dependencies are found and sorted (removing duplicates) + assert.Equal(t, []string{"camel:core", "camel:http4", "camel:twitter"}, dependencies) +} ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services