6
6
import io .fabric8 .kubernetes .api .model .ObjectMetaBuilder ;
7
7
import io .fabric8 .kubernetes .client .DefaultKubernetesClient ;
8
8
import io .fabric8 .kubernetes .client .KubernetesClient ;
9
+ import org .junit .jupiter .api .BeforeEach ;
9
10
import org .junit .jupiter .api .Test ;
10
11
import org .junit .jupiter .api .TestInstance ;
11
12
@@ -22,6 +23,7 @@ public class SubResourceUpdateIT {
22
23
23
24
private IntegrationTestSupport integrationTestSupport = new IntegrationTestSupport ();
24
25
26
+ @ BeforeEach
25
27
public void initAndCleanup () {
26
28
KubernetesClient k8sClient = new DefaultKubernetesClient ();
27
29
integrationTestSupport .initialize (k8sClient , new SubResourceTestCustomResourceController (),
@@ -31,7 +33,6 @@ public void initAndCleanup() {
31
33
32
34
@ Test
33
35
public void updatesSubResourceStatus () {
34
- initAndCleanup ();
35
36
integrationTestSupport .teardownIfSuccess (() -> {
36
37
SubResourceTestCustomResource resource = createTestCustomResource ("1" );
37
38
integrationTestSupport .getCrOperations ().inNamespace (TEST_NAMESPACE ).create (resource );
@@ -49,7 +50,6 @@ public void updatesSubResourceStatus() {
49
50
*/
50
51
@ Test
51
52
public void ifNoFinalizerPresentFirstAddsTheFinalizerThenExecutesControllerAgain () {
52
- initAndCleanup ();
53
53
integrationTestSupport .teardownIfSuccess (() -> {
54
54
SubResourceTestCustomResource resource = createTestCustomResource ("1" );
55
55
resource .getMetadata ().getFinalizers ().clear ();
@@ -71,7 +71,6 @@ public void ifNoFinalizerPresentFirstAddsTheFinalizerThenExecutesControllerAgain
71
71
* */
72
72
@ Test
73
73
public void updateCustomResourceAfterSubResourceChange () {
74
- initAndCleanup ();
75
74
integrationTestSupport .teardownIfSuccess (() -> {
76
75
SubResourceTestCustomResource resource = createTestCustomResource ("1" );
77
76
integrationTestSupport .getCrOperations ().inNamespace (TEST_NAMESPACE ).create (resource );
0 commit comments