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

Function TestJavaSourceDataFormat

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

Source from the content-addressed store, hash-verified

115`
116
117func TestJavaSourceDataFormat(t *testing.T) {
118 tc := []struct {
119 source string
120 deps []string
121 }{
122 {
123 source: javaSourceJSONEip,
124 deps: []string{"camel:jackson"},
125 },
126 {
127 source: javaSourceJSONJacksonEip,
128 deps: []string{"camel:jackson"},
129 },
130 {
131 source: javaSourceAvroEndpoint,
132 deps: []string{"camel:dataformat", "camel:avro"},
133 },
134 {
135 source: javaSourceJacksonEndpoint,
136 deps: []string{"camel:dataformat", "camel:jackson"},
137 },
138 {
139 source: javaSourceProtobufEndpoint,
140 deps: []string{"camel:dataformat", "camel:protobuf"},
141 },
142 }
143
144 inspector := newTestJavaSourceInspector(t)
145 for i := range tc {
146 test := tc[i]
147 t.Run(fmt.Sprintf("TestJavaSourceDataFormat-%d", i), func(t *testing.T) {
148 assertExtract(t, inspector, test.source, func(meta *Metadata) {
149 for _, d := range test.deps {
150 assert.Contains(t, meta.Dependencies.List(), d)
151 }
152 })
153 })
154 }
155}
156
157func TestJavaReplaceURI(t *testing.T) {
158 inspector := newTestJavaSourceInspector(t)

Callers

nothing calls this directly

Calls 4

assertExtractFunction · 0.85
ContainsMethod · 0.80
ListMethod · 0.65

Tested by

no test coverage detected