MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/buildpacks / TestMainFromManifestFail

Function TestMainFromManifestFail

pkg/java/java_test.go:151–176  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

149}
150
151func TestMainFromManifestFail(t *testing.T) {
152 testCases := []struct {
153 name string
154 manifestContents string
155 }{
156 {
157 name: "empty manifest",
158 manifestContents: ``,
159 },
160 {
161 name: "no main-class entry found",
162 manifestContents: `key: value`,
163 },
164 }
165
166 for _, tc := range testCases {
167 t.Run(tc.name, func(t *testing.T) {
168 mfPath := setupTestManifest(t, []byte(tc.manifestContents))
169 ctx := gcp.NewContext()
170 _, err := MainFromManifest(ctx, mfPath)
171 if err == nil {
172 t.Error("MainFromMainfest() did not error as expected")
173 }
174 })
175 }
176}
177
178func TestCheckCacheNewDateMiss(t *testing.T) {
179 testCases := []struct {

Callers

nothing calls this directly

Calls 3

setupTestManifestFunction · 0.85
MainFromManifestFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected