test: Fix test db setup and add lombok annotations (#6)
* Fix test db setup and add lombok annotations * Formatting
This commit is contained in:
parent
c3da0eff5c
commit
a2aea580f2
6 changed files with 26 additions and 41 deletions
|
|
@ -1,7 +1,5 @@
|
|||
package de.mlessmann.certassist;
|
||||
|
||||
import static org.slf4j.LoggerFactory.getLogger;
|
||||
|
||||
import de.mlessmann.certassist.except.UnresolvableCLIDependency;
|
||||
import java.io.File;
|
||||
import java.nio.file.Files;
|
||||
|
|
@ -9,22 +7,21 @@ import java.nio.file.Path;
|
|||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.SystemUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class ExecutableResolver {
|
||||
|
||||
private static final Logger LOGGER = getLogger(ExecutableResolver.class);
|
||||
|
||||
@Value("${openssl.path:#{null}}")
|
||||
private String opensslPath;
|
||||
|
||||
public String getOpenSSLPath() throws UnresolvableCLIDependency {
|
||||
if (opensslPath == null) {
|
||||
LOGGER.atDebug().log("No openssl path configured, falling back to resolving by shell.");
|
||||
log.atDebug().log("No openssl path configured, falling back to resolving by shell.");
|
||||
var optSSLPath = searchCommandFromPath("openssl");
|
||||
opensslPath = optSSLPath.orElseThrow(() -> new UnresolvableCLIDependency("openssl", "openssl.path"));
|
||||
}
|
||||
|
|
@ -51,7 +48,7 @@ public class ExecutableResolver {
|
|||
}
|
||||
}
|
||||
|
||||
LOGGER.error(
|
||||
log.error(
|
||||
"Could not find executable '{}' in PATH. Make sure that it exists on the of the directory and is executable.",
|
||||
executableName
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue