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 Jul 31, 2023
1 parent 5bfe82e commit a749724
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 27 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));
}
}
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 a749724

Please sign in to comment.