66import java .io .IOException ;
77import java .net .InetAddress ;
88import java .net .UnknownHostException ;
9- import java .net .http .HttpResponse ;
109import java .nio .file .Path ;
1110import java .nio .file .Paths ;
1211import java .time .OffsetDateTime ;
3130import oracle .weblogic .kubernetes .logging .LoggingFacade ;
3231import oracle .weblogic .kubernetes .utils .ExecCommand ;
3332import oracle .weblogic .kubernetes .utils .ExecResult ;
34- import oracle .weblogic .kubernetes .utils .OracleHttpClient ;
3533import org .junit .jupiter .api .BeforeAll ;
3634import org .junit .jupiter .api .DisplayName ;
3735import org .junit .jupiter .api .Tag ;
4644import static oracle .weblogic .kubernetes .TestConstants .KUBERNETES_CLI ;
4745import static oracle .weblogic .kubernetes .TestConstants .MII_BASIC_IMAGE_NAME ;
4846import static oracle .weblogic .kubernetes .TestConstants .MII_BASIC_IMAGE_TAG ;
47+ import static oracle .weblogic .kubernetes .TestConstants .OCNE ;
4948import static oracle .weblogic .kubernetes .TestConstants .OKE_CLUSTER ;
5049import static oracle .weblogic .kubernetes .TestConstants .TEST_IMAGES_REPO_SECRET_NAME ;
5150import static oracle .weblogic .kubernetes .actions .ActionConstants .MODEL_DIR ;
5251import static oracle .weblogic .kubernetes .actions .ActionConstants .RESOURCE_DIR ;
5352import static oracle .weblogic .kubernetes .actions .ActionConstants .WORK_DIR ;
5453import static oracle .weblogic .kubernetes .actions .TestActions .addLabelsToNamespace ;
5554import static oracle .weblogic .kubernetes .actions .TestActions .patchDomainResourceWithNewIntrospectVersion ;
55+ import static oracle .weblogic .kubernetes .utils .ApplicationUtils .checkAppUsingHostHeader ;
5656import static oracle .weblogic .kubernetes .utils .ClusterUtils .createClusterResourceAndAddReferenceToDomain ;
5757import static oracle .weblogic .kubernetes .utils .CommonMiiTestUtils .replaceConfigMapWithModelFiles ;
5858import static oracle .weblogic .kubernetes .utils .CommonMiiTestUtils .verifyIntrospectorRuns ;
@@ -243,25 +243,18 @@ void testIstioModelInImageDomain() throws UnknownHostException, IOException, Int
243243 String hostAndPort = getServiceExtIPAddrtOke (istioIngressServiceName , istioNamespace ) != null
244244 ? getServiceExtIPAddrtOke (istioIngressServiceName , istioNamespace ) : host + ":" + istioIngressPort ;
245245
246- Map <String , String > headers = new HashMap <>();
247- headers .put ("host" , domainNamespace + ".org" );
248- headers .put ("Authorization" , ADMIN_USERNAME_DEFAULT + ":" + ADMIN_PASSWORD_DEFAULT );
249-
250246 String workManagers = "/management/weblogic/latest/domainConfig/selfTuning/workManagers/" ;
251247 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 ) {
253249 istioIngressPort = ISTIO_HTTP_HOSTPORT ;
254250 hostAndPort = InetAddress .getLocalHost ().getHostAddress () + ":" + istioIngressPort ;
255251 }
256252
257253 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+
263256 String wmUrl = "http://" + hostAndPort + workManagers ;
264- checkApp (wmUrl , headers );
257+ checkApp (wmUrl );
265258
266259 if (OKE_CLUSTER ) {
267260 // create secret for internal OKE cluster
@@ -287,9 +280,10 @@ void testIstioModelInImageDomain() throws UnknownHostException, IOException, Int
287280 verifyIntrospectorRuns (domainUid , domainNamespace );
288281
289282 wmUrl = "http://" + hostAndPort + workManagers ;
290- checkApp (wmUrl , headers );
283+ checkApp (wmUrl );
284+
291285 wmUrl = "http://" + hostAndPort + newWM ;
292- checkApp (wmUrl , headers );
286+ checkApp (wmUrl );
293287 logger .info ("Found new work manager runtime" );
294288
295289 verifyPodsNotRolled (domainNamespace , pods );
@@ -355,12 +349,9 @@ private static void enableStrictMode(String namespace) {
355349 });
356350 }
357351
358- private void checkApp (String url , Map < String , String > headers ) {
352+ private void checkApp (String url ) {
359353 testUntil (
360- () -> {
361- HttpResponse <String > response = OracleHttpClient .get (url , headers , true );
362- return response .statusCode () == 200 ;
363- },
354+ () -> checkAppUsingHostHeader (url , domainNamespace + ".org" ),
364355 logger ,
365356 "application to be ready {0}" ,
366357 url );
0 commit comments