Skip to content

Commit 8484a7f

Browse files
committed
[Fix #737] Adding test module
Signed-off-by: fjtirado <ftirados@redhat.com>
1 parent 3f1a2f6 commit 8484a7f

File tree

67 files changed

+117
-159
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+117
-159
lines changed

impl/http/pom.xml

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -16,58 +16,5 @@
1616
<groupId>io.serverlessworkflow</groupId>
1717
<artifactId>serverlessworkflow-impl-core</artifactId>
1818
</dependency>
19-
<dependency>
20-
<groupId>io.serverlessworkflow</groupId>
21-
<artifactId>serverlessworkflow-jwt</artifactId>
22-
</dependency>
23-
<dependency>
24-
<groupId>org.glassfish.jersey.media</groupId>
25-
<artifactId>jersey-media-json-jackson</artifactId>
26-
</dependency>
27-
<dependency>
28-
<groupId>org.glassfish.jersey.core</groupId>
29-
<artifactId>jersey-client</artifactId>
30-
</dependency>
31-
<dependency>
32-
<groupId>io.serverlessworkflow</groupId>
33-
<artifactId>serverlessworkflow-api</artifactId>
34-
<scope>test</scope>
35-
</dependency>
36-
<dependency>
37-
<groupId>io.serverlessworkflow</groupId>
38-
<artifactId>serverlessworkflow-impl-jackson</artifactId>
39-
<scope>test</scope>
40-
</dependency>
41-
<dependency>
42-
<groupId>io.serverlessworkflow</groupId>
43-
<artifactId>serverlessworkflow-impl-jackson-jwt</artifactId>
44-
<scope>test</scope>
45-
</dependency>
46-
<dependency>
47-
<groupId>org.junit.jupiter</groupId>
48-
<artifactId>junit-jupiter-api</artifactId>
49-
</dependency>
50-
<dependency>
51-
<groupId>org.junit.jupiter</groupId>
52-
<artifactId>junit-jupiter-engine</artifactId>
53-
</dependency>
54-
<dependency>
55-
<groupId>org.junit.jupiter</groupId>
56-
<artifactId>junit-jupiter-params</artifactId>
57-
</dependency>
58-
<dependency>
59-
<groupId>org.assertj</groupId>
60-
<artifactId>assertj-core</artifactId>
61-
</dependency>
62-
<dependency>
63-
<groupId>ch.qos.logback</groupId>
64-
<artifactId>logback-classic</artifactId>
65-
<scope>test</scope>
66-
</dependency>
67-
<dependency>
68-
<groupId>com.squareup.okhttp3</groupId>
69-
<artifactId>mockwebserver</artifactId>
70-
<scope>test</scope>
71-
</dependency>
7219
</dependencies>
7320
</project>

impl/http/src/main/java/io/serverlessworkflow/impl/executors/http/OAuth2AuthProvider.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
import io.serverlessworkflow.api.types.OAuth2AuthenticationPolicy;
1919
import io.serverlessworkflow.api.types.Oauth2;
2020
import io.serverlessworkflow.api.types.Workflow;
21-
import io.serverlessworkflow.http.jwt.JWT;
2221
import io.serverlessworkflow.impl.TaskContext;
2322
import io.serverlessworkflow.impl.WorkflowApplication;
2423
import io.serverlessworkflow.impl.WorkflowContext;
2524
import io.serverlessworkflow.impl.WorkflowModel;
25+
import io.serverlessworkflow.impl.executors.http.oauth.JWT;
2626
import io.serverlessworkflow.impl.executors.http.oauth.OAuthRequestBuilder;
2727
import jakarta.ws.rs.client.Invocation;
2828
import jakarta.ws.rs.client.Invocation.Builder;
@@ -54,11 +54,7 @@ public void preRequest(
5454
Invocation.Builder builder, WorkflowContext workflow, TaskContext task, WorkflowModel model) {
5555
JWT jwt = requestBuilder.build(workflow, task, model).validateAndGet();
5656
String type =
57-
jwt.claim("typ", String.class)
58-
.map(String::trim)
59-
.filter(t -> !t.isEmpty())
60-
.orElseThrow(() -> new IllegalStateException("Token type is not present"));
61-
57+
jwt.type().orElseThrow(() -> new IllegalStateException("Token type is not present"));
6258
builder.header(
6359
AuthProviderFactory.AUTH_HEADER_NAME, String.format(BEARER_TOKEN, type, jwt.token()));
6460
}

impl/http/src/main/java/io/serverlessworkflow/impl/executors/http/oauth/AccessTokenProvider.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
*/
1616
package io.serverlessworkflow.impl.executors.http.oauth;
1717

18-
import io.serverlessworkflow.http.jwt.JWT;
19-
import io.serverlessworkflow.http.jwt.JWTConverter;
2018
import io.serverlessworkflow.impl.TaskContext;
2119
import java.util.List;
2220
import java.util.Map;

impl/jwt/src/main/java/io/serverlessworkflow/http/jwt/JWT.java renamed to impl/http/src/main/java/io/serverlessworkflow/impl/executors/http/oauth/JWT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package io.serverlessworkflow.http.jwt;
16+
package io.serverlessworkflow.impl.executors.http.oauth;
1717

1818
import java.time.Instant;
1919
import java.util.List;

impl/jwt/src/main/java/io/serverlessworkflow/http/jwt/JWTConverter.java renamed to impl/http/src/main/java/io/serverlessworkflow/impl/executors/http/oauth/JWTConverter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package io.serverlessworkflow.http.jwt;
16+
package io.serverlessworkflow.impl.executors.http.oauth;
1717

1818
public interface JWTConverter {
1919

impl/jackson/pom.xml

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -28,34 +28,5 @@
2828
<groupId>net.thisptr</groupId>
2929
<artifactId>jackson-jq</artifactId>
3030
</dependency>
31-
<dependency>
32-
<groupId>org.junit.jupiter</groupId>
33-
<artifactId>junit-jupiter-api</artifactId>
34-
<scope>test</scope>
35-
</dependency>
36-
<dependency>
37-
<groupId>org.junit.jupiter</groupId>
38-
<artifactId>junit-jupiter-engine</artifactId>
39-
<scope>test</scope>
40-
</dependency>
41-
<dependency>
42-
<groupId>org.junit.jupiter</groupId>
43-
<artifactId>junit-jupiter-params</artifactId>
44-
<scope>test</scope>
45-
</dependency>
46-
<dependency>
47-
<groupId>org.assertj</groupId>
48-
<artifactId>assertj-core</artifactId>
49-
<scope>test</scope>
50-
</dependency>
51-
<dependency>
52-
<groupId>ch.qos.logback</groupId>
53-
<artifactId>logback-classic</artifactId>
54-
<scope>test</scope>
55-
</dependency>
56-
<dependency>
57-
<groupId>org.mockito</groupId>
58-
<artifactId>mockito-core</artifactId>
59-
</dependency>
6031
</dependencies>
6132
</project>

impl/jackson/src/main/java/io/serverlessworkflow/impl/expressions/jq/JacksonModelFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
import io.serverlessworkflow.impl.WorkflowModel;
2828
import io.serverlessworkflow.impl.WorkflowModelCollection;
2929
import io.serverlessworkflow.impl.WorkflowModelFactory;
30-
import io.serverlessworkflow.impl.events.json.JacksonCloudEventUtils;
3130
import io.serverlessworkflow.impl.jackson.JsonUtils;
31+
import io.serverlessworkflow.impl.jackson.events.JacksonCloudEventUtils;
3232
import java.math.BigDecimal;
3333
import java.time.OffsetDateTime;
3434
import java.util.Map;

impl/jackson/src/main/java/io/serverlessworkflow/impl/events/json/JacksonCloudEventUtils.java renamed to impl/jackson/src/main/java/io/serverlessworkflow/impl/jackson/events/JacksonCloudEventUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package io.serverlessworkflow.impl.events.json;
16+
package io.serverlessworkflow.impl.jackson.events;
1717

1818
import com.fasterxml.jackson.databind.JsonNode;
1919
import com.fasterxml.jackson.databind.node.NullNode;

impl/jackson/src/main/java/io/serverlessworkflow/impl/events/json/JacksonLifeCyclePublisher.java renamed to impl/jackson/src/main/java/io/serverlessworkflow/impl/jackson/events/JacksonLifeCyclePublisher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package io.serverlessworkflow.impl.events.json;
16+
package io.serverlessworkflow.impl.jackson.events;
1717

1818
import com.fasterxml.jackson.core.JsonProcessingException;
1919
import io.serverlessworkflow.impl.jackson.JsonUtils;

impl/jackson/src/main/java/io/serverlessworkflow/impl/schema/json/JsonSchemaValidator.java renamed to impl/jackson/src/main/java/io/serverlessworkflow/impl/jackson/schema/JsonSchemaValidator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package io.serverlessworkflow.impl.schema.json;
16+
package io.serverlessworkflow.impl.jackson.schema;
1717

1818
import com.fasterxml.jackson.databind.JsonNode;
1919
import com.networknt.schema.JsonSchema;

0 commit comments

Comments
 (0)