Skip to content

Commit 242b676

Browse files
committed
Adjust tests and fixture
1 parent 435cedc commit 242b676

3 files changed

Lines changed: 9 additions & 17 deletions

File tree

src/integration/frameworks_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,13 +671,16 @@ func testFrameworks(platform switchblade.Platform, fixtures string) func(*testin
671671
}).
672672
WithEnv(map[string]string{
673673
"BP_JAVA_VERSION": "11",
674+
"JBP_CONFIG_JAVA_CF_ENV": "'{enabled: false}'",
674675
"JBP_CONFIG_SPRING_AUTO_RECONFIGURATION": "'{enabled: true}'",
675676
}).
676677
Execute(name, filepath.Join(fixtures, "frameworks", "auto_reconfiguration_servlet_3"))
677678
Expect(err).NotTo(HaveOccurred(), logs.String)
678679

679680
// Spring Auto-reconfiguration should be detected for Spring apps with services
680681
Expect(logs.String()).To(ContainSubstring("Spring Auto-reconfiguration"))
682+
// Spring Auto-reconfiguration should only be provided in the absence of Java Cf Env
683+
Expect(logs.String()).NotTo(ContainSubstring("Java CF Env"))
681684
Eventually(deployment).Should(matchers.Serve(ContainSubstring("")))
682685
})
683686

@@ -695,6 +698,8 @@ func testFrameworks(platform switchblade.Platform, fixtures string) func(*testin
695698
Execute(name, filepath.Join(fixtures, "frameworks", "auto_reconfiguration_servlet_3"))
696699
Expect(err).NotTo(HaveOccurred(), logs.String)
697700

701+
// Java Cf Env should be provided as it is enabled by default for Spring3 apps
702+
Expect(logs.String()).To(ContainSubstring("Java CF Env"))
698703
// Should not install when explicitly disabled
699704
Expect(logs.String()).NotTo(ContainSubstring("Spring Auto-reconfiguration"))
700705
Eventually(deployment).Should(matchers.Serve(ContainSubstring("")))

src/integration/spring_boot_test.go

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,6 @@ func testSpringBoot(platform switchblade.Platform, fixtures string) func(*testin
4949
})
5050
})
5151

52-
context("with Spring Auto-reconfiguration", func() {
53-
it("detects Spring Framework", func() {
54-
deployment, logs, err := platform.Deploy.
55-
WithEnv(map[string]string{
56-
"BP_JAVA_VERSION": "11",
57-
}).
58-
Execute(name, filepath.Join(fixtures, "containers", "spring_boot_staged"))
59-
Expect(err).NotTo(HaveOccurred(), logs.String)
60-
61-
// Spring auto-reconfiguration should be detected
62-
Expect(logs.String()).To(ContainSubstring("Java Buildpack"))
63-
Eventually(deployment).Should(matchers.Serve(Not(BeEmpty())))
64-
})
65-
})
66-
6752
context("with embedded Tomcat", func() {
6853
it("starts successfully", func() {
6954
deployment, logs, err := platform.Deploy.
@@ -85,11 +70,13 @@ func testSpringBoot(platform switchblade.Platform, fixtures string) func(*testin
8570
it("includes java-cfenv when Spring Boot is detected", func() {
8671
deployment, logs, err := platform.Deploy.
8772
WithEnv(map[string]string{
88-
"BP_JAVA_VERSION": "11",
89-
"JBP_CONFIG_JAVA_CFENV": "{enabled: true}",
73+
"BP_JAVA_VERSION": "11",
74+
"JBP_CONFIG_JAVA_CF_ENV": "{enabled: true}",
9075
}).
9176
Execute(name, filepath.Join(fixtures, "containers", "spring_boot_staged"))
9277
Expect(err).NotTo(HaveOccurred(), logs.String)
78+
// Fixture is not a Spring3 app, so Java CF Env detect should not pass
79+
Expect(logs.String()).NotTo(ContainSubstring("Java CF Env"))
9380

9481
Eventually(deployment).Should(matchers.Serve(Not(BeEmpty())))
9582
})

0 commit comments

Comments
 (0)