(t *testing.T)
| 57 | ` |
| 58 | |
| 59 | func TestJavaSourceKamelet(t *testing.T) { |
| 60 | tc := []struct { |
| 61 | source string |
| 62 | kamelets []string |
| 63 | }{ |
| 64 | { |
| 65 | source: javaSourceKameletEip, |
| 66 | kamelets: []string{"foo/bar"}, |
| 67 | }, |
| 68 | { |
| 69 | source: javaSourceKameletEndpoint, |
| 70 | kamelets: []string{"foo/bar"}, |
| 71 | }, |
| 72 | { |
| 73 | source: javaSourceWireTapEip, |
| 74 | kamelets: []string{"foo/bar"}, |
| 75 | }, |
| 76 | } |
| 77 | |
| 78 | inspector := newTestJavaSourceInspector(t) |
| 79 | for i := range tc { |
| 80 | test := tc[i] |
| 81 | t.Run(fmt.Sprintf("TestJavaSourceKamelet-%d", i), func(t *testing.T) { |
| 82 | assertExtract(t, inspector, test.source, func(meta *Metadata) { |
| 83 | assert.True(t, meta.RequiredCapabilities.IsEmpty()) |
| 84 | for _, k := range test.kamelets { |
| 85 | assert.Contains(t, meta.Kamelets, k) |
| 86 | } |
| 87 | }) |
| 88 | }) |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | const javaSourceJSONEip = ` |
| 93 | from("direct:start") |
nothing calls this directly
no test coverage detected