29
29
import oracle .kubernetes .operator .VersionConstants ;
30
30
import oracle .kubernetes .operator .work .FiberTestSupport ;
31
31
import oracle .kubernetes .operator .work .TerminalStep ;
32
+ import oracle .kubernetes .weblogic .domain .v2 .Cluster ;
32
33
import oracle .kubernetes .weblogic .domain .v2 .Domain ;
33
34
import oracle .kubernetes .weblogic .domain .v2 .DomainSpec ;
34
35
import org .hamcrest .Matcher ;
35
36
import org .junit .After ;
36
37
import org .junit .Before ;
38
+ import org .junit .Test ;
37
39
38
40
@ SuppressWarnings ({"ConstantConditions, unchecked" , "SameParameterValue" , "deprecation" })
39
41
public class DomainIntrospectorJobTest {
@@ -155,6 +157,8 @@ private DomainPresenceInfo createDomainPresenceInfo(Domain domain) {
155
157
156
158
@ SuppressWarnings ("deprecation" )
157
159
private DomainSpec createDomainSpec () {
160
+ Cluster cluster = new Cluster ().withClusterName ("cluster-1" );
161
+ cluster .setReplicas (1 );
158
162
DomainSpec spec =
159
163
new DomainSpec ()
160
164
.withDomainName (DOMAIN_NAME )
@@ -163,6 +167,7 @@ private DomainSpec createDomainSpec() {
163
167
.withAsPort (ADMIN_PORT )
164
168
.withAdminSecret (new V1SecretReference ().name (ADMIN_SECRET_NAME ))
165
169
.withConfigOverrides (OVERRIDES_CM )
170
+ .withCluster (cluster )
166
171
.withImage (LATEST_IMAGE );
167
172
168
173
List <String > overrideSecrets = new ArrayList ();
@@ -181,7 +186,7 @@ String getJobDeletedMessageKey() {
181
186
return JOB_DELETED ;
182
187
}
183
188
184
- // @Test
189
+ @ Test
185
190
public void whenNoJob_createIt () {
186
191
expectCreateJob (jobWithName (getJobName ())).returning (createJobModel ());
187
192
expectListPods (NS ).returning (createListPods ());
@@ -200,7 +205,7 @@ public void whenNoJob_createIt() {
200
205
testSupport .verifyAllDefinedResponsesInvoked ();
201
206
}
202
207
203
- // @Test
208
+ @ Test
204
209
public void whenNoJob_retryOnFailure () {
205
210
testSupport .addRetryStrategy (retryStrategy );
206
211
expectCreateJob (jobWithName (getJobName ())).failingWithStatus (401 );
@@ -213,12 +218,12 @@ public void whenNoJob_retryOnFailure() {
213
218
testSupport .verifyAllDefinedResponsesInvoked ();
214
219
}
215
220
216
- // @Test
221
+ @ Test
217
222
public void whenJobCreated_specHasOneContainer () {
218
223
assertThat (getCreatedJob ().getSpec ().getTemplate ().getSpec ().getContainers (), hasSize (1 ));
219
224
}
220
225
221
- // @Test
226
+ @ Test
222
227
public void whenJobCreated_containerHasExpectedVolumeMounts () {
223
228
assertThat (
224
229
getCreatedJobSpecContainer ().getVolumeMounts (),
@@ -232,7 +237,7 @@ public void whenJobCreated_containerHasExpectedVolumeMounts() {
232
237
}
233
238
234
239
@ SuppressWarnings ("unchecked" )
235
- // @Test
240
+ @ Test
236
241
public void whenJobCreated_hasPredefinedEnvVariables () {
237
242
assertThat (
238
243
getCreatedJobSpecContainer ().getEnv (),
0 commit comments