6
6
import java .io .IOException ;
7
7
import java .net .InetAddress ;
8
8
import java .net .UnknownHostException ;
9
- import java .net .http .HttpResponse ;
10
9
import java .nio .file .Path ;
11
10
import java .nio .file .Paths ;
12
11
import java .time .OffsetDateTime ;
31
30
import oracle .weblogic .kubernetes .logging .LoggingFacade ;
32
31
import oracle .weblogic .kubernetes .utils .ExecCommand ;
33
32
import oracle .weblogic .kubernetes .utils .ExecResult ;
34
- import oracle .weblogic .kubernetes .utils .OracleHttpClient ;
35
33
import org .junit .jupiter .api .BeforeAll ;
36
34
import org .junit .jupiter .api .DisplayName ;
37
35
import org .junit .jupiter .api .Tag ;
46
44
import static oracle .weblogic .kubernetes .TestConstants .KUBERNETES_CLI ;
47
45
import static oracle .weblogic .kubernetes .TestConstants .MII_BASIC_IMAGE_NAME ;
48
46
import static oracle .weblogic .kubernetes .TestConstants .MII_BASIC_IMAGE_TAG ;
47
+ import static oracle .weblogic .kubernetes .TestConstants .OCNE ;
49
48
import static oracle .weblogic .kubernetes .TestConstants .OKE_CLUSTER ;
50
49
import static oracle .weblogic .kubernetes .TestConstants .TEST_IMAGES_REPO_SECRET_NAME ;
51
50
import static oracle .weblogic .kubernetes .actions .ActionConstants .MODEL_DIR ;
52
51
import static oracle .weblogic .kubernetes .actions .ActionConstants .RESOURCE_DIR ;
53
52
import static oracle .weblogic .kubernetes .actions .ActionConstants .WORK_DIR ;
54
53
import static oracle .weblogic .kubernetes .actions .TestActions .addLabelsToNamespace ;
55
54
import static oracle .weblogic .kubernetes .actions .TestActions .patchDomainResourceWithNewIntrospectVersion ;
55
+ import static oracle .weblogic .kubernetes .utils .ApplicationUtils .checkAppUsingHostHeader ;
56
56
import static oracle .weblogic .kubernetes .utils .ClusterUtils .createClusterResourceAndAddReferenceToDomain ;
57
57
import static oracle .weblogic .kubernetes .utils .CommonMiiTestUtils .replaceConfigMapWithModelFiles ;
58
58
import static oracle .weblogic .kubernetes .utils .CommonMiiTestUtils .verifyIntrospectorRuns ;
@@ -243,25 +243,18 @@ void testIstioModelInImageDomain() throws UnknownHostException, IOException, Int
243
243
String hostAndPort = getServiceExtIPAddrtOke (istioIngressServiceName , istioNamespace ) != null
244
244
? getServiceExtIPAddrtOke (istioIngressServiceName , istioNamespace ) : host + ":" + istioIngressPort ;
245
245
246
- Map <String , String > headers = new HashMap <>();
247
- headers .put ("host" , domainNamespace + ".org" );
248
- headers .put ("Authorization" , ADMIN_USERNAME_DEFAULT + ":" + ADMIN_PASSWORD_DEFAULT );
249
-
250
246
String workManagers = "/management/weblogic/latest/domainConfig/selfTuning/workManagers/" ;
251
247
String newWM = workManagers + "newWM/" ;
252
- if (!TestConstants .WLSIMG_BUILDER .equals (TestConstants .WLSIMG_BUILDER_DEFAULT )) {
248
+ if (!TestConstants .WLSIMG_BUILDER .equals (TestConstants .WLSIMG_BUILDER_DEFAULT ) && ! OCNE ) {
253
249
istioIngressPort = ISTIO_HTTP_HOSTPORT ;
254
250
hostAndPort = InetAddress .getLocalHost ().getHostAddress () + ":" + istioIngressPort ;
255
251
}
256
252
257
253
String url = "http://" + hostAndPort + "/management/tenant-monitoring/servers/" ;
258
- HttpResponse <String > response ;
259
- response = OracleHttpClient .get (url , headers , true );
260
- assertEquals (200 , response .statusCode ());
261
- assertTrue (response .body ().contains ("RUNNING" ));
262
-
254
+ checkApp (url );
255
+
263
256
String wmUrl = "http://" + hostAndPort + workManagers ;
264
- checkApp (wmUrl , headers );
257
+ checkApp (wmUrl );
265
258
266
259
if (OKE_CLUSTER ) {
267
260
// create secret for internal OKE cluster
@@ -287,9 +280,10 @@ void testIstioModelInImageDomain() throws UnknownHostException, IOException, Int
287
280
verifyIntrospectorRuns (domainUid , domainNamespace );
288
281
289
282
wmUrl = "http://" + hostAndPort + workManagers ;
290
- checkApp (wmUrl , headers );
283
+ checkApp (wmUrl );
284
+
291
285
wmUrl = "http://" + hostAndPort + newWM ;
292
- checkApp (wmUrl , headers );
286
+ checkApp (wmUrl );
293
287
logger .info ("Found new work manager runtime" );
294
288
295
289
verifyPodsNotRolled (domainNamespace , pods );
@@ -355,12 +349,9 @@ private static void enableStrictMode(String namespace) {
355
349
});
356
350
}
357
351
358
- private void checkApp (String url , Map < String , String > headers ) {
352
+ private void checkApp (String url ) {
359
353
testUntil (
360
- () -> {
361
- HttpResponse <String > response = OracleHttpClient .get (url , headers , true );
362
- return response .statusCode () == 200 ;
363
- },
354
+ () -> checkAppUsingHostHeader (url , domainNamespace + ".org" ),
364
355
logger ,
365
356
"application to be ready {0}" ,
366
357
url );
0 commit comments