MCPcopy Create free account
hub / github.com/apache/camel-k / TestJavaSourceKamelet

Function TestJavaSourceKamelet

pkg/util/source/inspector_java_source_test.go:59–90  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

57`
58
59func 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
92const javaSourceJSONEip = `
93from("direct:start")

Callers

nothing calls this directly

Calls 4

assertExtractFunction · 0.85
ContainsMethod · 0.80
IsEmptyMethod · 0.45

Tested by

no test coverage detected