From a2e5fac5dfa2699e12348fc61c48c6a319ca3f77 Mon Sep 17 00:00:00 2001 From: walaniam Date: Mon, 14 Aug 2023 09:29:30 +0200 Subject: [PATCH] Bugfix: issue 239 (#597) --- .../oss/boat/GenerateFromDirectoryDocMojo.java | 5 ++--- .../java/com/backbase/oss/boat/GeneratorTests.java | 13 +++---------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/GenerateFromDirectoryDocMojo.java b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/GenerateFromDirectoryDocMojo.java index 3620312e4..fe752ef4a 100644 --- a/boat-maven-plugin/src/main/java/com/backbase/oss/boat/GenerateFromDirectoryDocMojo.java +++ b/boat-maven-plugin/src/main/java/com/backbase/oss/boat/GenerateFromDirectoryDocMojo.java @@ -10,6 +10,7 @@ import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; +import java.nio.file.InvalidPathException; import java.nio.file.StandardOpenOption; import java.util.ArrayList; import java.util.Arrays; @@ -83,12 +84,10 @@ private void writeMarkers(List success, List failed) throws MojoExec StandardOpenOption.CREATE, StandardOpenOption.APPEND); - } catch (IOException e) { + } catch (IOException | InvalidPathException e) { log.error("Failed to write BOAT markers to: {}", markersDirectory, e); throw new MojoExecutionException("Failed to write BOAT markers", e); - } - } } diff --git a/boat-maven-plugin/src/test/java/com/backbase/oss/boat/GeneratorTests.java b/boat-maven-plugin/src/test/java/com/backbase/oss/boat/GeneratorTests.java index db6ce323e..4fee9b2f8 100644 --- a/boat-maven-plugin/src/test/java/com/backbase/oss/boat/GeneratorTests.java +++ b/boat-maven-plugin/src/test/java/com/backbase/oss/boat/GeneratorTests.java @@ -1,26 +1,21 @@ package com.backbase.oss.boat; -import static org.assertj.core.api.Assertions.assertThat; - import lombok.extern.slf4j.Slf4j; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.project.MavenProject; -import org.apache.maven.shared.invoker.*; import org.codehaus.plexus.logging.console.ConsoleLogger; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.function.Executable; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.CsvSource; -import org.junit.jupiter.params.provider.ValueSource; import org.sonatype.plexus.build.incremental.DefaultBuildContext; import java.io.File; import java.util.*; +import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; @Slf4j class GeneratorTests { @@ -189,8 +184,6 @@ void testBoatDocsWithNonExistingMarkersDirectory() { mojo.markersDirectory = new File(" //43243 \\d a1r1\4t 11t134 t835jyz"); mojo.execute(); }); - - } @Test