chore: Make TestOpenSSLCertificateCreator a spring boot test

This commit is contained in:
Magnus Leßmann (@MarkL4YG) 2024-11-23 12:50:56 +01:00
parent dd2e11c8e8
commit 97eea3a20f
2 changed files with 19 additions and 10 deletions

View file

@ -9,14 +9,23 @@ import java.nio.file.Path;
import java.util.Objects;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
@SpringBootTest
class TestOpenSSLCertificateCreator {
public static final String TEST_CERT_PASSPHRASE = "ABC-123";
public static final Path TEST_CERT_PATH = Path.of("src/test/resources/openssl");
public static final String ERR_NOT_ENCRYPTED = "Private key not encrypted";
public static final String ERR_VERIFY_FAILED = "Certificate verification failed";
private CertificatePasswordProvider passwordProvider;
@Autowired
OpenSSLCertificateCreator openSSLCertificateCreator;
@MockBean
CertificatePasswordProvider passwordProvider;
@BeforeEach
void setUp() {