-
Notifications
You must be signed in to change notification settings - Fork 2
/
detect_test.go
55 lines (48 loc) · 1.13 KB
/
detect_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package ubi8javaextension_test
import (
"testing"
libcnb "github.com/buildpacks/libcnb/v2"
ubi8javaextension "github.com/paketo-community/ubi-java-extension/v1"
. "github.com/onsi/gomega"
"github.com/paketo-buildpacks/libjvm/v2"
"github.com/sclevine/spec"
)
func testDetect(t *testing.T, context spec.G, it spec.S) {
var (
Expect = NewWithT(t).Expect
dc libcnb.DetectContext
result libcnb.DetectResult
err error
)
context("Detect Result Check", func() {
it.Before(func() {
dc = libcnb.DetectContext{}
})
it("includes build plan options", func() {
result, err = ubi8javaextension.Detect(dc)
Expect(err).NotTo(HaveOccurred())
Expect(result).To(Equal(
libcnb.DetectResult{
Pass: true,
Plans: []libcnb.BuildPlan{
{
Provides: []libcnb.BuildPlanProvide{
{Name: libjvm.PlanEntryJDK},
{Name: libjvm.PlanEntryJRE},
},
},
{
Provides: []libcnb.BuildPlanProvide{
{Name: libjvm.PlanEntryJDK},
},
},
{
Provides: []libcnb.BuildPlanProvide{
{Name: libjvm.PlanEntryJRE},
},
},
},
}))
})
})
}