Skip to content

Commit

Permalink
Workflow failure: Fuse adapter tests
Browse files Browse the repository at this point in the history
Closes: keycloak#27021

Signed-off-by: Simon Vacek <simonvacky@email.cz>
  • Loading branch information
vaceksimon committed Apr 23, 2024
1 parent c8a5618 commit 7c73089
Show file tree
Hide file tree
Showing 18 changed files with 138 additions and 59 deletions.
8 changes: 8 additions & 0 deletions testsuite/integration-arquillian/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,14 @@
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Fuse adapter tests dependencies END -->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

{
"realm": "demo",
"resource": "product-portal",
"auth-server-url": "http://localhost:8080/auth",
"ssl-required" : "external",
"credentials": {
"secret": "password"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
<include>keycloak-direct-access.json</include>
<include>keycloak-hawtio-client.json</include>
<include>keycloak-hawtio.json</include>
<include>product-portal-keycloak.json</include>
</includes>
</resource>
</resources>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
javax.servlet;version="[3.1,5)",
javax.servlet.http;version="[3.1,5)",
javax.net.ssl,
org.apache.camel.*,
io.undertow.*;version="[1.4,3)",
org.apache.camel;version="[2.13,3)",
org.keycloak.*;version="${fuse.adapter.version}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@
<supportedProjectType>war</supportedProjectType>
</supportedProjectTypes>
<instructions>
<Webapp-Context>customer-portal</Webapp-Context>
<Web-ContextPath>customer-portal</Web-ContextPath>
<Webapp-Context>/customer-portal</Webapp-Context>
<Web-ContextPath>/customer-portal</Web-ContextPath>
<Embed-Directory>WEB-INF/lib</Embed-Directory>
<Bundle-ClassPath>.,WEB-INF/classes</Bundle-ClassPath>
<Bundle-Name>${project.name}</Bundle-Name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@
<artifactId>cxf-rt-transports-http-undertow</artifactId>
<version>${cxf.undertow.version}</version>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.1</version>
<scope>compile</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

package org.keycloak.example.rs;

import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import java.util.ArrayList;
import java.util.List;

Expand Down
45 changes: 36 additions & 9 deletions testsuite/integration-arquillian/test-apps/fuse/demorealm.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,10 @@
"redirectUris": [
"http://localhost:8181/customer-portal/*"
],
"secret": "password"
"secret": "password",
"attributes": {
"exclude.issuer.from.auth.response": "true"
}
},
{
"clientId": "product-portal",
Expand All @@ -208,7 +211,10 @@
"redirectUris": [
"http://localhost:8181/product-portal/*"
],
"secret": "password"
"secret": "password",
"attributes": {
"exclude.issuer.from.auth.response": "true"
}
},
{
"clientId": "builtin-cxf-app",
Expand All @@ -218,36 +224,51 @@
"redirectUris": [
"http://localhost:8181/cxf/*"
],
"secret": "password"
"secret": "password",
"attributes": {
"exclude.issuer.from.auth.response": "true"
}
},
{
"clientId": "custom-cxf-endpoint",
"enabled": true,
"adminUrl": "http://localhost:8282/PersonServiceCF",
"baseUrl": "http://localhost:8282/PersonServiceCF",
"bearerOnly": true
"bearerOnly": true,
"attributes": {
"exclude.issuer.from.auth.response": "true"
}
},
{
"clientId": "admin-camel-endpoint",
"enabled": true,
"adminUrl": "http://localhost:8383/admin-camel-endpoint",
"baseUrl": "http://localhost:8383/admin-camel-endpoint",
"bearerOnly": true
"bearerOnly": true,
"attributes": {
"exclude.issuer.from.auth.response": "true"
}
},
{
"clientId": "admin-camel-restdsl",
"enabled": true,
"adminUrl": "http://localhost:8484/restdsl",
"baseUrl": "http://localhost:8484/restdsl",
"bearerOnly": true
"bearerOnly": true,
"attributes": {
"exclude.issuer.from.auth.response": "true"
}
},
{
"clientId": "ssh-jmx-admin-client",
"enabled": true,
"publicClient": false,
"standardFlowEnabled": false,
"directAccessGrantsEnabled": true,
"secret": "password"
"secret": "password",
"attributes": {
"exclude.issuer.from.auth.response": "true"
}
},
{
"clientId": "external-config",
Expand All @@ -258,7 +279,10 @@
"http://localhost:8181/external-config",
"http://localhost:8181/external-config/*"
],
"secret": "password"
"secret": "password",
"attributes": {
"exclude.issuer.from.auth.response": "true"
}
},
{
"clientId" : "hawtio-client",
Expand All @@ -269,7 +293,10 @@
"webOrigins" : [ "http://localhost:8080", "http://localhost:8181", "http://localhost:8081" ],
"bearerOnly" : false,
"publicClient" : true,
"protocol" : "openid-connect"
"protocol" : "openid-connect",
"attributes": {
"exclude.issuer.from.auth.response": "true"
}
}

],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@
<supportedProjectType>war</supportedProjectType>
</supportedProjectTypes>
<instructions>
<Webapp-Context>external-config</Webapp-Context>
<Web-ContextPath>external-config</Web-ContextPath>
<Webapp-Context>/external-config</Webapp-Context>
<Web-ContextPath>/external-config</Web-ContextPath>
<Embed-Directory>WEB-INF/lib</Embed-Directory>
<Bundle-Name>${project.name}</Bundle-Name>
<Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<feature name="keycloak-fuse-7.0-example" version="${project.version}">
<details>The Keycloak / Fuse 7.0 on Undertow example</details>
<feature>pax-http-undertow</feature>
<feature>pax-web-http-undertow</feature>
<feature>war</feature>
<feature>camel</feature>
<feature>camel-undertow</feature>
Expand Down
2 changes: 1 addition & 1 deletion testsuite/integration-arquillian/test-apps/fuse/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<packaging>pom</packaging>
<properties>
<camel.version>2.21.2</camel.version>
<fuse.adapter.version>18.0.7</fuse.adapter.version>
<fuse.adapter.version>18.0.12</fuse.adapter.version>
</properties>
<modules>
<module>customer-app-fuse</module>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws Se
out.println("<html><head><title>Product Portal Page</title></head><body>");

String logoutUri = KeycloakUriBuilder.fromUri("http://localhost:8080/auth").path(ServiceUrlConstants.TOKEN_SERVICE_LOGOUT_PATH)
.queryParam("redirect_uri", "http://localhost:8181/product-portal").build("demo").toString();
.build("demo").toString();
String acctUri = KeycloakUriBuilder.fromUri("http://localhost:8080/auth").path(ServiceUrlConstants.ACCOUNT_SERVICE_PATH)
.queryParam("referrer", "product-portal").build("demo").toString();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,25 @@

<bean id="productServlet" class="org.keycloak.example.ProductPortalServlet" depends-on="keycloakPaxWebIntegration" />

<service ref="productServlet" interface="javax.servlet.Servlet">
<!--service ref="productServlet" interface="javax.servlet.Servlet">
<service-properties>
<entry key="alias" value="/product-portal" />
<entry key="alias" value="/product-portal/*" />
<entry key="servlet-name" value="ProductServlet" />
<entry key="keycloak.config.file" value="/keycloak.json" />
</service-properties>
</service-->

<service ref="productServlet" interface="javax.servlet.Servlet">
<service-properties>
<entry key="osgi.http.whiteboard.servlet.name" value="ProductServlet" />
<entry key="osgi.http.whiteboard.servlet.pattern">
<array value-type="java.lang.String">
<value>/product-portal/*</value>
</array>
</entry>
<entry key="keycloak.config" value="/keycloak.json" />
</service-properties>
</service>


</blueprint>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"realm": "demo",
"resource": "product-portal",
"auth-server-url": "http://localhost:8080/auth",
"ssl-required" : "external",
"credentials": {
"secret": "password"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.openqa.selenium.TimeoutException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.safari.SafariDriver;
Expand Down Expand Up @@ -250,8 +251,8 @@ public static boolean isInputElementValid(WebElement element) {
}

public static String getRawPageSource(WebDriver driver) {
if (driver instanceof FirefoxDriver) {
// firefox has some weird "bug" – it wraps xml in html
if (driver instanceof FirefoxDriver || driver instanceof ChromeDriver) {
// firefox and chrome has some weird "bug" – it wraps xml in html
return driver.findElement(By.tagName("body")).getText();
}
else {
Expand Down
Loading

0 comments on commit 7c73089

Please sign in to comment.