Skip to content

Commit

Permalink
[KOGITO-9614] Making test work
Browse files Browse the repository at this point in the history
  • Loading branch information
fjtirado committed Aug 1, 2023
1 parent 7bdfc81 commit a045817
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ public ValidationLogDecorator(Map<String, Exception> exceptions) {

@Override
public void decorate() {
exceptions.forEach((processId, exception) -> LOGGER.error("Invalid process: '{}'. Found error: {}", processId, exception));
exceptions.forEach((processId, exception) -> LOGGER.error("Invalid process: '{}'", processId, exception));
}
}
5 changes: 0 additions & 5 deletions kogito-build/kogito-dependencies-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,8 @@
<version.net.minidev.jsonsmart>2.4.10</version.net.minidev.jsonsmart>
<version.net.thisptr.jackson-jq>1.0.0-preview.20220705</version.net.thisptr.jackson-jq>
<version.io.quarkiverse.jackson-jq>1.1.0</version.io.quarkiverse.jackson-jq>
<<<<<<< Upstream, based on main
<version.io.quarkiverse.openapi.generator>1.3.8</version.io.quarkiverse.openapi.generator>
<version.io.quarkiverse.asyncapi>0.0.3</version.io.quarkiverse.asyncapi>
=======
<version.io.quarkiverse.openapi.generator>1.2.1</version.io.quarkiverse.openapi.generator>
<version.io.quarkiverse.asyncapi>0.0.4</version.io.quarkiverse.asyncapi>
>>>>>>> 5bfe82e [KOGITO-9614] Updating POM
<version.io.quarkiverse.reactivemessaging.http>1.1.5</version.io.quarkiverse.reactivemessaging.http>
<version.io.quarkiverse.embedded.postgresql>0.0.8</version.io.quarkiverse.embedded.postgresql>
<version.com.github.haifengl.smile>1.5.2</version.com.github.haifengl.smile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,20 @@ private static WorkflowOperationResource getResource(Workflow workflow, Function
}

private static Optional<Workflow> getWorkflow(Path path) {
return workflowCache.computeIfAbsent(path, p -> SupportedExtensions.getSWFExtensions()
.stream()
.filter(e -> p.getFileName().toString().endsWith(e))
.map(e -> {
try (Reader r = Files.newBufferedReader(p)) {
return Optional.of(ServerlessWorkflowUtils.getWorkflow(r, WorkflowFormat.fromFileName(p.getFileName())));
} catch (IOException ex) {
if (ConfigProvider.getConfig().getOptionalValue(FAIL_ON_ERROR_PROPERTY, Boolean.class).orElse(true)) {
throw new UncheckedIOException(ex);
} else {
logger.error("Error reading workflow file {}", p, ex);
return Optional.<Workflow> empty();
}
if (SupportedExtensions.getSWFExtensions().stream().anyMatch(ext -> path.toString().endsWith(ext))) {
return workflowCache.computeIfAbsent(path, p -> {
try (Reader r = Files.newBufferedReader(p)) {
return Optional.of(ServerlessWorkflowUtils.getWorkflow(r, WorkflowFormat.fromFileName(p.getFileName())));
} catch (IOException ex) {
if (ConfigProvider.getConfig().getOptionalValue(FAIL_ON_ERROR_PROPERTY, Boolean.class).orElse(true)) {
throw new UncheckedIOException(ex);
} else {
logger.error("Error reading workflow file {}", p, ex);
return Optional.<Workflow> empty();
}
}).flatMap(Optional::stream).findFirst());
}
});
}
return Optional.empty();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ public class WorkflowAsyncAPISpecInputProvider implements AsyncAPISpecInputProvi
@Override
public AsyncAPISpecInput read(ConfigSourceContext context) {
if (isSourceModule(context)) {
for (String dir : AsyncAPIUtils.getValues(context, "kogito.extensions.asyncAPI.scanDirs", Arrays.asList("src/main/resources", "src/test/resources"))) {
for (String dir : AsyncAPIUtils.getValues(context, "kogito.extensions.asyncAPI.scanDirs", Arrays.asList("src", "target"))) {
Path rootPath = Path.of(dir);
if (Files.exists(rootPath)) {
if (Files.isDirectory(rootPath)) {
try (Stream<Path> workflowFiles = Files.walk(rootPath)) {
return new AsyncAPISpecInput(WorkflowCodeGenUtils
.operationResources(workflowFiles, f -> f.getType() == Type.ASYNCAPI,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,15 @@
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty-shaded</artifactId>
<version>${version.io.grpc}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
<version>${version.io.grpc}</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
<version>${version.io.grpc}</version>
</dependency>
<dependency>
<!-- necessary for Java 9+ -->
<groupId>org.apache.tomcat</groupId>
<artifactId>annotations-api</artifactId>
<version>6.0.53</version>
<scope>provided</scope>
</dependency>

<dependency>
Expand Down

0 comments on commit a045817

Please sign in to comment.