Commit f4757c8
authored
[go-migration] Refactor common context, generate mocks, fix hollow unit tests for supply/finalize (#1177)
[go-migration] Refactor context to interfaces and fix hollow unit tests for supply/finalize
Introduces Go interfaces (Stager, Manifest, Installer, Command) in the
common context to replace concrete libbuildpack types, enabling mock
generation via gomock. Previously, the supply and finalize unit tests
always passed vacuously — this PR rewrites them to actually exercise
`supply.Run()` and `finalize.Run()` for Tomcat, Spring Boot, and Groovy
containers using generated mocks, without performing real dependency
downloads. Adds a new finalize test case for the Groovy container.
Also consolidates the `Installer` interface from `cf_metrics_exporter`
into the shared common context and fixes related test setup.
Fixes #11721 parent 014701d commit f4757c8
17 files changed
Lines changed: 2054 additions & 98 deletions
File tree
- src
- internal/mocks
- java
- common
- finalize
- frameworks
- supply
- vendor
- github.com/golang/mock
- gomock
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
45 | | - | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
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 | + | |
13 | 42 | | |
14 | 43 | | |
15 | 44 | | |
16 | | - | |
17 | | - | |
18 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
19 | 48 | | |
20 | | - | |
| 49 | + | |
21 | 50 | | |
22 | 51 | | |
23 | 52 | | |
| |||
0 commit comments