jstastny-cz opened a new issue, #622:
URL: https://github.com/apache/incubator-kie-issues/issues/622

   ```
   public class KogitoKeycloakContainer extends 
KogitoGenericContainer<KogitoKeycloakContainer> implements TestResource {
   ...
       public KogitoKeycloakContainer() {
           super(NAME);
           addExposedPort(PORT);
           withEnv("KEYCLOAK_ADMIN", USER);
           withEnv("KEYCLOAK_ADMIN_PASSWORD", PASSWORD);
           
withClasspathResourceMapping("testcontainers/keycloak/kogito-realm.json", 
REALM_FILE, BindMode.READ_ONLY);
           waitingFor(Wait.forLogMessage(".*Keycloak.*started.*", 1));
           withCommand("start-dev --import-realm");
       }
   ...
   }
   ```
   The parent class is defined as
   ```
   public abstract class KogitoGenericContainer<T extends GenericContainer<T>> 
extends GenericContainer<T> {
   
   ...
   
       public KogitoGenericContainer(String containerName) {
           super(getImageName(containerName));
           withStartupTimeout(CONTAINER_START_TIMEOUT);
           withLogConsumer(new Slf4jLogConsumer(LOGGER));
           withLogConsumer(f -> System.out.print(f.getUtf8String()));
       }
   ...
   ```
   ....and what does withStartupTimeout do?
   ```
      public SELF withStartupTimeout(Duration startupTimeout) {
         this.getWaitStrategy().withStartupTimeout(startupTimeout);
         return (GenericContainer)this.self();
      }
   ```
   it tweaks current wait strategy .... and what does waitingFor() do?
   ```
      public SELF waitingFor(@NonNull WaitStrategy waitStrategy) {
         if (waitStrategy == null) {
            throw new NullPointerException("waitStrategy is marked non-null but 
is null");
         } else {
            this.waitStrategy = waitStrategy;
            return (GenericContainer)this.self();
         }
      }
   ```
   
   So the order of actions in case of KogitoKeycloakContainer is reversed, thus 
initial startupTimeout discarded by later invocation of waitingFor method.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to