7272import static oracle .weblogic .kubernetes .actions .TestActions .defaultWitParams ;
7373import static oracle .weblogic .kubernetes .actions .TestActions .deleteDomainCustomResource ;
7474import static oracle .weblogic .kubernetes .actions .TestActions .deleteImage ;
75- import static oracle .weblogic .kubernetes .actions .TestActions .deleteNamespace ;
76- import static oracle .weblogic .kubernetes .actions .TestActions .deleteServiceAccount ;
7775import static oracle .weblogic .kubernetes .actions .TestActions .dockerLogin ;
7876import static oracle .weblogic .kubernetes .actions .TestActions .dockerPush ;
7977import static oracle .weblogic .kubernetes .actions .TestActions .execCommand ;
8078import static oracle .weblogic .kubernetes .actions .TestActions .getOperatorImageName ;
8179import static oracle .weblogic .kubernetes .actions .TestActions .installOperator ;
82- import static oracle .weblogic .kubernetes .actions .TestActions .uninstallOperator ;
8380import static oracle .weblogic .kubernetes .actions .TestActions .upgradeOperator ;
8481import static oracle .weblogic .kubernetes .assertions .TestAssertions .doesImageExist ;
8582import static oracle .weblogic .kubernetes .assertions .TestAssertions .domainExists ;
@@ -508,7 +505,10 @@ public void testCreateMiiDomainSameDomainUidDiffNS() {
508505 }
509506
510507
511- private void tearDown () {
508+ // This method is needed in this test class, since the cleanup util
509+ // won't cleanup the images.
510+ @ AfterAll
511+ void tearDown () {
512512
513513 // Delete domain custom resource
514514 logger .info ("Delete domain custom resource in namespace {0}" , domainNamespace );
@@ -533,51 +533,6 @@ private void tearDown() {
533533
534534 }
535535
536- /**
537- * Uninstall Operator, delete service account, domain namespace and
538- * operator namespace.
539- */
540- @ AfterAll
541- public void tearDownAll () {
542- tearDown ();
543- // uninstall operator release
544- logger .info ("Uninstall Operator in namespace {0}" , opNamespace );
545- if (opHelmParams != null ) {
546- uninstallOperator (opHelmParams );
547- }
548- // Delete service account from unique opNamespace
549- logger .info ("Delete service account in namespace {0}" , opNamespace );
550- if (serviceAccount != null ) {
551- assertDoesNotThrow (() -> deleteServiceAccount (serviceAccount .getMetadata ().getName (),
552- serviceAccount .getMetadata ().getNamespace ()),
553- "deleteServiceAccount failed with ApiException" );
554- }
555- // Delete domain namespaces
556- logger .info ("Deleting domain namespace {0}" , domainNamespace );
557- if (domainNamespace != null ) {
558- assertDoesNotThrow (() -> deleteNamespace (domainNamespace ),
559- "deleteNamespace failed with ApiException" );
560- logger .info ("Deleted namespace: " + domainNamespace );
561- }
562-
563- // Delete domain namespaces
564- logger .info ("Deleting domain namespace {0}" , domainNamespace1 );
565- if (domainNamespace1 != null ) {
566- assertDoesNotThrow (() -> deleteNamespace (domainNamespace1 ),
567- "deleteNamespace failed with ApiException" );
568- logger .info ("Deleted namespace: " + domainNamespace1 );
569- }
570-
571- // Delete opNamespace
572- logger .info ("Deleting Operator namespace {0}" , opNamespace );
573- if (opNamespace != null ) {
574- assertDoesNotThrow (() -> deleteNamespace (opNamespace ),
575- "deleteNamespace failed with ApiException" );
576- logger .info ("Deleted namespace: " + opNamespace );
577- }
578-
579- }
580-
581536 private String createImageAndVerify () {
582537 // create unique image name with date
583538 DateFormat dateFormat = new SimpleDateFormat ("yyyy-MM-dd" );
0 commit comments