Skip to content

Commit

Permalink
updating test to use new file uri prefix
Browse files Browse the repository at this point in the history
Signed-off-by: Shawn Hurley <[email protected]>
  • Loading branch information
shawn-hurley committed Sep 14, 2023
1 parent 8eb028d commit 851c799
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 24 deletions.
32 changes: 16 additions & 16 deletions provider/internal/java/dependency_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func Test_parseMavenDepLines(t *testing.T) {
labels.AsString(provider.DepSourceLabel, "internal"),
labels.AsString(provider.DepLanguageLabel, "java"),
},
FileURIPrefix: "konveyor-jdt://contentstestdata/junit/junit/4.11",
FileURIPrefix: "file://testdata/junit/junit/4.11",
},
AddedDeps: []provider.DepDAGItem{
{
Expand All @@ -72,7 +72,7 @@ func Test_parseMavenDepLines(t *testing.T) {
labels.AsString(provider.DepSourceLabel, "internal"),
labels.AsString(provider.DepLanguageLabel, "java"),
},
FileURIPrefix: "konveyor-jdt://contentstestdata/org/hamcrest/hamcrest-core/1.3",
FileURIPrefix: "file://testdata/org/hamcrest/hamcrest-core/1.3",
},
},
},
Expand All @@ -88,7 +88,7 @@ func Test_parseMavenDepLines(t *testing.T) {
labels.AsString(provider.DepSourceLabel, "internal"),
labels.AsString(provider.DepLanguageLabel, "java"),
},
FileURIPrefix: "konveyor-jdt://contentstestdata/io/fabric8/kubernetes-client/6.0.0",
FileURIPrefix: "file://testdata/io/fabric8/kubernetes-client/6.0.0",
},
AddedDeps: []provider.DepDAGItem{
{
Expand All @@ -102,7 +102,7 @@ func Test_parseMavenDepLines(t *testing.T) {
labels.AsString(provider.DepSourceLabel, "internal"),
labels.AsString(provider.DepLanguageLabel, "java"),
},
FileURIPrefix: "konveyor-jdt://contentstestdata/io/fabric8/kubernetes-httpclient-okhttp/6.0.0",
FileURIPrefix: "file://testdata/io/fabric8/kubernetes-httpclient-okhttp/6.0.0",
},
},
{
Expand All @@ -116,7 +116,7 @@ func Test_parseMavenDepLines(t *testing.T) {
labels.AsString(provider.DepSourceLabel, "internal"),
labels.AsString(provider.DepLanguageLabel, "java"),
},
FileURIPrefix: "konveyor-jdt://contentstestdata/com/squareup/okhttp3/okhttp/3.12.12",
FileURIPrefix: "file://testdata/com/squareup/okhttp3/okhttp/3.12.12",
},
},
{
Expand All @@ -130,7 +130,7 @@ func Test_parseMavenDepLines(t *testing.T) {
labels.AsString(provider.DepSourceLabel, "internal"),
labels.AsString(provider.DepLanguageLabel, "java"),
},
FileURIPrefix: "konveyor-jdt://contentstestdata/com/squareup/okio/okio/1.15.0",
FileURIPrefix: "file://testdata/com/squareup/okio/okio/1.15.0",
},
},
{
Expand All @@ -144,7 +144,7 @@ func Test_parseMavenDepLines(t *testing.T) {
labels.AsString(provider.DepSourceLabel, "internal"),
labels.AsString(provider.DepLanguageLabel, "java"),
},
FileURIPrefix: "konveyor-jdt://contentstestdata/com/squareup/okhttp3/logging-interceptor/3.12.12",
FileURIPrefix: "file://testdata/com/squareup/okhttp3/logging-interceptor/3.12.12",
},
},
{
Expand All @@ -158,7 +158,7 @@ func Test_parseMavenDepLines(t *testing.T) {
labels.AsString(provider.DepSourceLabel, "internal"),
labels.AsString(provider.DepLanguageLabel, "java"),
},
FileURIPrefix: "konveyor-jdt://contentstestdata/io/fabric8/zjsonpatch/0.3.0",
FileURIPrefix: "file://testdata/io/fabric8/zjsonpatch/0.3.0",
},
},
},
Expand Down Expand Up @@ -193,7 +193,7 @@ func Test_parseMavenDepLines(t *testing.T) {
labels.AsString(provider.DepSourceLabel, "open-source"),
labels.AsString(provider.DepLanguageLabel, "java"),
},
FileURIPrefix: "konveyor-jdt://contentstestdata/junit/junit/4.11",
FileURIPrefix: "file://testdata/junit/junit/4.11",
},
AddedDeps: []provider.DepDAGItem{
{
Expand All @@ -208,7 +208,7 @@ func Test_parseMavenDepLines(t *testing.T) {
labels.AsString(provider.DepSourceLabel, "internal"),
labels.AsString(provider.DepLanguageLabel, "java"),
},
FileURIPrefix: "konveyor-jdt://contentstestdata/org/hamcrest/hamcrest-core/1.3",
FileURIPrefix: "file://testdata/org/hamcrest/hamcrest-core/1.3",
},
},
},
Expand All @@ -224,7 +224,7 @@ func Test_parseMavenDepLines(t *testing.T) {
labels.AsString(provider.DepSourceLabel, "internal"),
labels.AsString(provider.DepLanguageLabel, "java"),
},
FileURIPrefix: "konveyor-jdt://contentstestdata/io/fabric8/kubernetes-client/6.0.0",
FileURIPrefix: "file://testdata/io/fabric8/kubernetes-client/6.0.0",
},
AddedDeps: []provider.DepDAGItem{
{
Expand All @@ -238,7 +238,7 @@ func Test_parseMavenDepLines(t *testing.T) {
labels.AsString(provider.DepSourceLabel, "internal"),
labels.AsString(provider.DepLanguageLabel, "java"),
},
FileURIPrefix: "konveyor-jdt://contentstestdata/io/fabric8/kubernetes-httpclient-okhttp/6.0.0",
FileURIPrefix: "file://testdata/io/fabric8/kubernetes-httpclient-okhttp/6.0.0",
},
},
{
Expand All @@ -252,7 +252,7 @@ func Test_parseMavenDepLines(t *testing.T) {
labels.AsString(provider.DepSourceLabel, "internal"),
labels.AsString(provider.DepLanguageLabel, "java"),
},
FileURIPrefix: "konveyor-jdt://contentstestdata/com/squareup/okhttp3/okhttp/3.12.12",
FileURIPrefix: "file://testdata/com/squareup/okhttp3/okhttp/3.12.12",
},
},
{
Expand All @@ -266,7 +266,7 @@ func Test_parseMavenDepLines(t *testing.T) {
labels.AsString(provider.DepSourceLabel, "internal"),
labels.AsString(provider.DepLanguageLabel, "java"),
},
FileURIPrefix: "konveyor-jdt://contentstestdata/com/squareup/okio/okio/1.15.0",
FileURIPrefix: "file://testdata/com/squareup/okio/okio/1.15.0",
},
},
{
Expand All @@ -280,7 +280,7 @@ func Test_parseMavenDepLines(t *testing.T) {
labels.AsString(provider.DepSourceLabel, "internal"),
labels.AsString(provider.DepLanguageLabel, "java"),
},
FileURIPrefix: "konveyor-jdt://contentstestdata/com/squareup/okhttp3/logging-interceptor/3.12.12",
FileURIPrefix: "file://testdata/com/squareup/okhttp3/logging-interceptor/3.12.12",
},
},
{
Expand All @@ -294,7 +294,7 @@ func Test_parseMavenDepLines(t *testing.T) {
labels.AsString(provider.DepSourceLabel, "internal"),
labels.AsString(provider.DepLanguageLabel, "java"),
},
FileURIPrefix: "konveyor-jdt://contentstestdata/io/fabric8/zjsonpatch/0.3.0",
FileURIPrefix: "file://testdata/io/fabric8/zjsonpatch/0.3.0",
},
},
},
Expand Down
14 changes: 6 additions & 8 deletions provider/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,14 @@ func Test_matchDepLabelSelector(t *testing.T) {
name: "no deps, incident should match",
labelSelector: "!konveyor.io/dep-source=open-source",
incident: IncidentContext{
FileURI: "konveyor-jdt://test-file-uri",
FileURI: "file://test-file-uri",
},
want: true,
},
{
name: "incident does not come from a dep, should match",
labelSelector: "!konveyor.io/dep-source=open-source",
incident: IncidentContext{
FileURI: "file://test-file-uri/test-file",
},
incident: IncidentContext{},
deps: map[uri.URI][]*konveyor.Dep{
"pom.xml": {
{
Expand All @@ -185,7 +183,7 @@ func Test_matchDepLabelSelector(t *testing.T) {
name: "label selector matches",
labelSelector: "konveyor.io/dep-source=open-source",
incident: IncidentContext{
FileURI: "konveyor-jdt://test-file-uri/test-file",
FileURI: "file://test-file-uri/test-file",
},
deps: map[uri.URI][]*konveyor.Dep{
"pom.xml": {
Expand All @@ -196,7 +194,7 @@ func Test_matchDepLabelSelector(t *testing.T) {
Labels: []string{
"konveyor.io/dep-source=open-source",
},
FileURIPrefix: "konveyor-jdt://test-file-uri",
FileURIPrefix: "file://test-file-uri",
},
},
},
Expand All @@ -206,7 +204,7 @@ func Test_matchDepLabelSelector(t *testing.T) {
name: "label selector does not match",
labelSelector: "!konveyor.io/dep-source=exclude",
incident: IncidentContext{
FileURI: "konveyor-jdt://test-file-uri/test-file",
FileURI: "file://test-file-uri/test-file",
},
deps: map[uri.URI][]*konveyor.Dep{
"pom.xml": {
Expand All @@ -217,7 +215,7 @@ func Test_matchDepLabelSelector(t *testing.T) {
Labels: []string{
"konveyor.io/dep-source=exclude",
},
FileURIPrefix: "konveyor-jdt://test-file-uri",
FileURIPrefix: "file://test-file-uri",
},
},
},
Expand Down

0 comments on commit 851c799

Please sign in to comment.