5
5
package oracle .kubernetes .operator .create ;
6
6
7
7
import static java .util .Arrays .asList ;
8
- import static oracle .kubernetes .operator .LabelConstants .*;
9
- import static oracle .kubernetes .operator .VersionConstants .*;
8
+ import static oracle .kubernetes .operator .LabelConstants .APP_LABEL ;
9
+ import static oracle .kubernetes .operator .LabelConstants .CLUSTERNAME_LABEL ;
10
+ import static oracle .kubernetes .operator .LabelConstants .DOMAINNAME_LABEL ;
11
+ import static oracle .kubernetes .operator .LabelConstants .DOMAINUID_LABEL ;
12
+ import static oracle .kubernetes .operator .LabelConstants .RESOURCE_VERSION_LABEL ;
13
+ import static oracle .kubernetes .operator .VersionConstants .APACHE_LOAD_BALANCER_V1 ;
14
+ import static oracle .kubernetes .operator .VersionConstants .DOMAIN_V1 ;
15
+ import static oracle .kubernetes .operator .VersionConstants .TRAEFIK_LOAD_BALANCER_V1 ;
16
+ import static oracle .kubernetes .operator .VersionConstants .VOYAGER_LOAD_BALANCER_V1 ;
10
17
import static oracle .kubernetes .operator .utils .CreateDomainInputs .readInputsYamlFile ;
11
- import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .*;
18
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .API_GROUP_RBAC ;
19
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .API_VERSION_APPS_V1BETA1 ;
20
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .API_VERSION_EXTENSIONS_V1BETA1 ;
21
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .API_VERSION_RBAC_V1 ;
22
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .KIND_CLUSTER_ROLE ;
23
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .KIND_SERVICE_ACCOUNT ;
24
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .containsRegexps ;
25
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .getThenEmptyConfigMapDataValue ;
26
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newClusterRole ;
27
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newClusterRoleBinding ;
28
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newClusterStartup ;
29
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newClusterStartupList ;
30
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newConfigMap ;
31
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newConfigMapVolumeSource ;
32
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newContainer ;
33
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newContainerPort ;
34
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newDeployment ;
35
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newDeploymentSpec ;
36
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newDomain ;
37
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newDomainSpec ;
38
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newEnvVar ;
39
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newEnvVarList ;
40
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newHTTPGetAction ;
41
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newHostPathVolumeSource ;
42
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newIntOrString ;
43
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newJob ;
44
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newJobSpec ;
45
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newLabelSelector ;
46
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newLocalObjectReferenceList ;
47
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newObjectMeta ;
48
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newPersistentVolume ;
49
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newPersistentVolumeClaim ;
50
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newPersistentVolumeClaimSpec ;
51
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newPersistentVolumeClaimVolumeSource ;
52
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newPersistentVolumeSpec ;
53
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newPodSpec ;
54
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newPodTemplateSpec ;
55
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newPolicyRule ;
56
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newProbe ;
57
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newResourceRequirements ;
58
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newRoleRef ;
59
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newSecretReference ;
60
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newSecretVolumeSource ;
61
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newServerStartup ;
62
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newServerStartupList ;
63
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newService ;
64
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newServiceAccount ;
65
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newServicePort ;
66
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newServiceSpec ;
67
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newSubject ;
68
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newTCPSocketAction ;
69
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newToleration ;
70
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newVolume ;
71
+ import static oracle .kubernetes .operator .utils .KubernetesArtifactUtils .newVolumeMount ;
12
72
import static oracle .kubernetes .operator .utils .YamlUtils .yamlEqualTo ;
13
73
import static org .hamcrest .MatcherAssert .assertThat ;
14
- import static org .hamcrest .Matchers .*;
74
+ import static org .hamcrest .Matchers .containsString ;
75
+ import static org .hamcrest .Matchers .is ;
15
76
16
77
import io .kubernetes .client .custom .Quantity ;
17
- import io .kubernetes .client .models .*;
18
- import oracle .kubernetes .operator .utils .CreateDomainInputs ;
78
+ import io .kubernetes .client .models .ExtensionsV1beta1Deployment ;
79
+ import io .kubernetes .client .models .V1ConfigMap ;
80
+ import io .kubernetes .client .models .V1Job ;
81
+ import io .kubernetes .client .models .V1PersistentVolume ;
82
+ import io .kubernetes .client .models .V1PersistentVolumeClaim ;
83
+ import io .kubernetes .client .models .V1Service ;
84
+ import io .kubernetes .client .models .V1ServiceAccount ;
85
+ import io .kubernetes .client .models .V1beta1ClusterRole ;
86
+ import io .kubernetes .client .models .V1beta1ClusterRoleBinding ;
87
+ import oracle .kubernetes .operator .utils .DomainValues ;
88
+ import oracle .kubernetes .operator .utils .DomainYamlFactory ;
19
89
import oracle .kubernetes .operator .utils .GeneratedDomainYamlFiles ;
20
90
import oracle .kubernetes .operator .utils .ParsedApacheSecurityYaml ;
21
91
import oracle .kubernetes .operator .utils .ParsedApacheYaml ;
30
100
import oracle .kubernetes .operator .utils .ParsedWeblogicDomainPersistentVolumeClaimYaml ;
31
101
import oracle .kubernetes .operator .utils .ParsedWeblogicDomainPersistentVolumeYaml ;
32
102
import oracle .kubernetes .weblogic .domain .v1 .Domain ;
33
- import org .junit .AfterClass ;
34
103
import org .junit .Test ;
35
104
36
105
/**
40
109
*/
41
110
public abstract class CreateDomainGeneratedFilesBaseTest {
42
111
43
- private static CreateDomainInputs inputs ;
112
+ private static DomainValues inputs ;
44
113
private static GeneratedDomainYamlFiles generatedFiles ;
114
+ private static DomainYamlFactory factory ;
45
115
46
116
private static final String PROPERTY_TRAEFIK_TOML = "traefik.toml" ;
47
117
private static final String PROPERTY_UTILITY_SH = "utility.sh" ;
@@ -50,31 +120,31 @@ public abstract class CreateDomainGeneratedFilesBaseTest {
50
120
private static final String PROPERTY_CREATE_DOMAIN_SCRIPT_SH = "create-domain-script.sh" ;
51
121
private static final String PROPERTY_CREATE_DOMAIN_PY = "create-domain.py" ;
52
122
53
- protected static CreateDomainInputs getInputs () {
123
+ protected static DomainValues getInputs () {
54
124
return inputs ;
55
125
}
56
126
57
- protected static GeneratedDomainYamlFiles getGeneratedFiles () {
127
+ private static GeneratedDomainYamlFiles getGeneratedFiles () {
58
128
return generatedFiles ;
59
129
}
60
130
61
- protected ParsedCreateWeblogicDomainJobYaml getCreateWeblogicDomainJobYaml () {
131
+ private ParsedCreateWeblogicDomainJobYaml getCreateWeblogicDomainJobYaml () {
62
132
return getGeneratedFiles ().getCreateWeblogicDomainJobYaml ();
63
133
}
64
134
65
- protected ParsedDeleteWeblogicDomainJobYaml getDeleteWeblogicDomainJobYaml () {
135
+ private ParsedDeleteWeblogicDomainJobYaml getDeleteWeblogicDomainJobYaml () {
66
136
return getGeneratedFiles ().getDeleteWeblogicDomainJobYaml ();
67
137
}
68
138
69
- protected ParsedDomainCustomResourceYaml getDomainCustomResourceYaml () {
139
+ private ParsedDomainCustomResourceYaml getDomainCustomResourceYaml () {
70
140
return getGeneratedFiles ().getDomainCustomResourceYaml ();
71
141
}
72
142
73
- protected ParsedTraefikSecurityYaml getTraefikSecurityYaml () {
143
+ private ParsedTraefikSecurityYaml getTraefikSecurityYaml () {
74
144
return getGeneratedFiles ().getTraefikSecurityYaml ();
75
145
}
76
146
77
- protected ParsedTraefikYaml getTraefikYaml () {
147
+ private ParsedTraefikYaml getTraefikYaml () {
78
148
return getGeneratedFiles ().getTraefikYaml ();
79
149
}
80
150
@@ -107,16 +177,10 @@ protected ParsedWeblogicDomainPersistentVolumeYaml getWeblogicDomainPersistentVo
107
177
return getGeneratedFiles ().getWeblogicDomainPersistentVolumeYaml ();
108
178
}
109
179
110
- protected static void setup (CreateDomainInputs val ) throws Exception {
111
- inputs = val ;
112
- generatedFiles = GeneratedDomainYamlFiles .generateDomainYamlFiles (getInputs ());
113
- }
114
-
115
- @ AfterClass
116
- public static void tearDown () throws Exception {
117
- if (generatedFiles != null ) {
118
- generatedFiles .remove ();
119
- }
180
+ protected static void setup (DomainYamlFactory factory , DomainValues values ) throws Exception {
181
+ CreateDomainGeneratedFilesBaseTest .factory = factory ;
182
+ inputs = values ;
183
+ generatedFiles = factory .generate (values );
120
184
}
121
185
122
186
@ Test
0 commit comments