Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-9199

Quickstart tests should fail when it's not properly configured

XMLWordPrintable

    • Icon: Feature Feature
    • Resolution: Done
    • Icon: Major Major
    • fuse-7.1
    • fuse-7.0.1, fuse-7.1
    • Examples
    • Fuse 7.1 Sprint 32

      When I was testing keycloak-camel-blueprint quickstart I forgot to set correct roles for a user. Then I ran "mvn clean install -Pqtest" with this output:

      ...
      11:38:22 WARN [org.jboss.fuse.quickstarts.security.keycloak.camel.CamelClientTest] : error: "unauthorized_client", description: "Invalid client secret"
      11:38:22 DEBUG [org.apache.http.wire] : http-outgoing-1 >> "GET /admin-camel-endpoint HTTP/1.1[\r][\n]"
      11:38:22 DEBUG [org.apache.http.wire] : http-outgoing-1 >> "Authorization: Bearer null[\r][\n]"
      11:38:22 DEBUG [org.apache.http.wire] : http-outgoing-1 >> "Host: localhost:8383[\r][\n]"
      11:38:22 DEBUG [org.apache.http.wire] : http-outgoing-1 >> "Connection: Keep-Alive[\r][\n]"
      11:38:22 DEBUG [org.apache.http.wire] : http-outgoing-1 >> "User-Agent: Apache-HttpClient/4.5.4 (Java/1.8.0_151)[\r][\n]"
      11:38:22 DEBUG [org.apache.http.wire] : http-outgoing-1 >> "[\r][\n]"
      11:38:22 DEBUG [org.apache.http.wire] : http-outgoing-1 << "HTTP/1.1 401 Unauthorized[\r][\n]"
      11:38:22 DEBUG [org.apache.http.wire] : http-outgoing-1 << "Connection: keep-alive[\r][\n]"
      11:38:22 DEBUG [org.apache.http.wire] : http-outgoing-1 << "WWW-Authenticate: Bearer realm="fuse7karaf", error="invalid_token", error_description="Failed to parse JWT"[\r][\n]"
      11:38:22 DEBUG [org.apache.http.wire] : http-outgoing-1 << "Content-Length: 0[\r][\n]"
      11:38:22 DEBUG [org.apache.http.wire] : http-outgoing-1 << "Date: Wed, 18 Jul 2018 09:38:22 GMT[\r][\n]"
      11:38:22 DEBUG [org.apache.http.wire] : http-outgoing-1 << "[\r][\n]"
      11:38:22 INFO [org.jboss.fuse.quickstarts.security.keycloak.camel.CamelClientTest] : response: 
      [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.224 s - in org.jboss.fuse.quickstarts.security.keycloak.camel.CamelClientTest
      [INFO] 
      [INFO] Results:
      [INFO] 
      [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
      [INFO] 
      [INFO] 
      [INFO] --- maven-bundle-plugin:3.5.1:bundle (default-bundle) @ keycloak-camel-blueprint ---
      [INFO] 
      [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ keycloak-camel-blueprint ---
      [INFO] Installing /home/jkasztur/repos/jenkins-jobs/fuse-server/quickstarts/security/keycloak/keycloak-camel-blueprint/target/keycloak-camel-blueprint-7.0.1.fuse-000011-redhat-2.jar to /home/jkasztur/.m2/repository/org/jboss/fuse/quickstarts/security/keycloak-camel-blueprint/7.0.1.fuse-000011-redhat-2/keycloak-camel-blueprint-7.0.1.fuse-000011-redhat-2.jar
      [INFO] Installing /home/jkasztur/repos/jenkins-jobs/fuse-server/quickstarts/security/keycloak/keycloak-camel-blueprint/pom.xml to /home/jkasztur/.m2/repository/org/jboss/fuse/quickstarts/security/keycloak-camel-blueprint/7.0.1.fuse-000011-redhat-2/keycloak-camel-blueprint-7.0.1.fuse-000011-redhat-2.pom
      [INFO] 
      [INFO] --- maven-bundle-plugin:3.5.1:install (default-install) @ keycloak-camel-blueprint ---
      [INFO] Local OBR update disabled (enable with -DobrRepository)
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESS
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 6.433 s
      [INFO] Finished at: 2018-07-18T11:38:23+02:00
      [INFO] Final Memory: 39M/409M
      [INFO] ------------------------------------------------------------------------
      

      The response is empty, the return code is 401 Unauthorized, but the test passed successfully. It should contains some check.

      Should be fixed also in other keycloak quickstarts.

              ggrzybek Grzegorz Grzybek
              jkasztur@redhat.com Jan Kasztura (Inactive)
              Jan Kasztura Jan Kasztura (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: