mirror of
https://github.com/apache/nifi.git
synced 2025-02-28 22:49:10 +00:00
NIFI-11130 Further updates from JUnit 4 to 5
This closes #6927 Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
parent
3e2e081d4b
commit
99b0cd42ef
@ -36,6 +36,10 @@ import org.testcontainers.junit.jupiter.Container
|
||||
import org.testcontainers.junit.jupiter.Testcontainers
|
||||
import org.testcontainers.utility.DockerImageName
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue
|
||||
|
||||
/**
|
||||
* Setup instructions:
|
||||
*
|
||||
@ -118,14 +122,13 @@ class CassandraDistributedMapCacheIT {
|
||||
|
||||
@Test
|
||||
void testContainsKey() {
|
||||
def contains = distributedMapCache.containsKey("contains-key", serializer)
|
||||
assert contains
|
||||
assertTrue(distributedMapCache.containsKey("contains-key", serializer))
|
||||
}
|
||||
|
||||
@Test
|
||||
void testGetAndPutIfAbsent() {
|
||||
def result = distributedMapCache.getAndPutIfAbsent('get-and-put-key', 'testing', serializer, serializer, deserializer)
|
||||
assert result == 'testvalue'
|
||||
String result = distributedMapCache.getAndPutIfAbsent('get-and-put-key', 'testing', serializer, serializer, deserializer)
|
||||
assertEquals("testvalue", result)
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -135,20 +138,20 @@ class CassandraDistributedMapCacheIT {
|
||||
|
||||
@Test
|
||||
void testGet() {
|
||||
def result = distributedMapCache.get("contains-key", serializer, deserializer)
|
||||
assert result == "testvalue"
|
||||
String result = distributedMapCache.get("contains-key", serializer, deserializer)
|
||||
assertEquals("testvalue", result)
|
||||
}
|
||||
|
||||
@Test
|
||||
void testPut() {
|
||||
distributedMapCache.put("put-key", "sometestdata", serializer, serializer)
|
||||
Thread.sleep(1000)
|
||||
assert distributedMapCache.containsKey("put-key", serializer)
|
||||
assertTrue(distributedMapCache.containsKey("put-key", serializer))
|
||||
}
|
||||
|
||||
@Test
|
||||
void testPutIfAbsent() {
|
||||
assert distributedMapCache.putIfAbsent("put-if-absent-key", "testingthis", serializer, serializer)
|
||||
assert !distributedMapCache.putIfAbsent("put-if-absent-key", "testingthis", serializer, serializer)
|
||||
assertTrue(distributedMapCache.putIfAbsent("put-if-absent-key", "testingthis", serializer, serializer))
|
||||
assertFalse(distributedMapCache.putIfAbsent("put-if-absent-key", "testingthis", serializer, serializer))
|
||||
}
|
||||
}
|
||||
|
@ -24,6 +24,7 @@ import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertSame;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
public class TestRulesFactory {
|
||||
@Test
|
||||
@ -32,7 +33,7 @@ public class TestRulesFactory {
|
||||
String testYamlFile = "src/test/resources/test_nifi_rules.yml";
|
||||
List<Rule> rules = RulesFactory.createRulesFromFile(testYamlFile, "YAML", "NIFI");
|
||||
assertEquals(2, rules.size());
|
||||
assert confirmEntries(rules);
|
||||
assertTrue(confirmEntries(rules));
|
||||
});
|
||||
}
|
||||
|
||||
@ -42,7 +43,7 @@ public class TestRulesFactory {
|
||||
String testYamlFile = "src/test/resources/test_mvel_rules.yml";
|
||||
List<Rule> rules = RulesFactory.createRulesFromFile(testYamlFile, "YAML", "MVEL");
|
||||
assertEquals(2, rules.size());
|
||||
assert confirmEntries(rules);
|
||||
assertTrue(confirmEntries(rules));
|
||||
assertSame("EXPRESSION", rules.get(0).getActions().get(0).getType());
|
||||
});
|
||||
}
|
||||
@ -63,7 +64,7 @@ public class TestRulesFactory {
|
||||
String testJsonFile = "src/test/resources/test_nifi_rules.json";
|
||||
List<Rule> rules = RulesFactory.createRulesFromFile(testJsonFile, "JSON", "NIFI");
|
||||
assertEquals(2, rules.size());
|
||||
assert confirmEntries(rules);
|
||||
assertTrue(confirmEntries(rules));
|
||||
});
|
||||
}
|
||||
|
||||
@ -74,7 +75,7 @@ public class TestRulesFactory {
|
||||
List<Rule> rules = RulesFactory.createRulesFromFile(testJsonFile, "JSON", "MVEL");
|
||||
assertEquals(2, rules.size());
|
||||
assertSame("EXPRESSION", rules.get(0).getActions().get(0).getType());
|
||||
assert confirmEntries(rules);
|
||||
assertTrue(confirmEntries(rules));
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -38,6 +38,9 @@ import java.nio.charset.StandardCharsets
|
||||
import java.nio.file.Path
|
||||
import java.security.Security
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertArrayEquals
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals
|
||||
|
||||
@DisabledOnOs(OS.WINDOWS)
|
||||
class EncryptedFileSystemRepositoryTest {
|
||||
private static final Logger logger = LoggerFactory.getLogger(EncryptedFileSystemRepositoryTest.class)
|
||||
@ -108,7 +111,7 @@ class EncryptedFileSystemRepositoryTest {
|
||||
void testReadNullContentClaimShouldReturnEmptyInputStream() {
|
||||
final InputStream inputStream = repository.read((ContentClaim) null)
|
||||
final int read = inputStream.read()
|
||||
assert read == -1
|
||||
assertEquals(-1, read)
|
||||
}
|
||||
|
||||
/**
|
||||
@ -129,8 +132,8 @@ class EncryptedFileSystemRepositoryTest {
|
||||
// Assert
|
||||
|
||||
// Use the EFSR to decrypt the same content
|
||||
def retrievedBytes = verifyClaimDecryption(claim, plainBytes)
|
||||
assert new String(retrievedBytes, StandardCharsets.UTF_8) == plainContent
|
||||
byte [] retrievedBytes = verifyClaimDecryption(claim, plainBytes)
|
||||
assertEquals(plainContent, new String(retrievedBytes, StandardCharsets.UTF_8))
|
||||
}
|
||||
|
||||
/**
|
||||
@ -175,8 +178,8 @@ class EncryptedFileSystemRepositoryTest {
|
||||
String pieceOfContent = content[i]
|
||||
|
||||
// Use the EFSR to decrypt the same content
|
||||
def retrievedBytes = verifyClaimDecryption(claim, pieceOfContent.bytes)
|
||||
assert new String(retrievedBytes, StandardCharsets.UTF_8) == pieceOfContent
|
||||
byte [] retrievedBytes = verifyClaimDecryption(claim, pieceOfContent.bytes)
|
||||
assertEquals(pieceOfContent, new String(retrievedBytes, StandardCharsets.UTF_8))
|
||||
}
|
||||
}
|
||||
|
||||
@ -200,7 +203,7 @@ class EncryptedFileSystemRepositoryTest {
|
||||
logger.info("Read bytes via repository (${retrievedContent.length}): ${pba(retrievedContent)}")
|
||||
|
||||
// Assert
|
||||
assert new String(retrievedContent, StandardCharsets.UTF_8) == plainContent
|
||||
assertEquals(plainContent, new String(retrievedContent, StandardCharsets.UTF_8))
|
||||
}
|
||||
|
||||
/**
|
||||
@ -297,7 +300,7 @@ class EncryptedFileSystemRepositoryTest {
|
||||
logger.info("Read bytes from output stream (${exportedBytes.length}): ${pba(exportedBytes)}")
|
||||
|
||||
// Assert
|
||||
assert exportedBytes == plainBytes
|
||||
assertArrayEquals(plainBytes, exportedBytes)
|
||||
}
|
||||
|
||||
/**
|
||||
@ -330,9 +333,9 @@ class EncryptedFileSystemRepositoryTest {
|
||||
logger.info("Read bytes from output stream (${exportedBytes.length}): ${pba(exportedBytes)}")
|
||||
|
||||
// Assert
|
||||
assert exportedBytes == plainBytes[offset..<(offset + length)] as byte[]
|
||||
assert exportedBytes.length == length
|
||||
assert bytesWritten == length
|
||||
assertArrayEquals(plainBytes[offset..<(offset + length)] as byte[], exportedBytes)
|
||||
assertEquals(length, exportedBytes.length)
|
||||
assertEquals(length, bytesWritten)
|
||||
}
|
||||
|
||||
/**
|
||||
@ -362,7 +365,7 @@ class EncryptedFileSystemRepositoryTest {
|
||||
|
||||
// Assert
|
||||
try {
|
||||
assert exportedBytes == plainBytes
|
||||
assertArrayEquals(plainBytes, exportedBytes)
|
||||
} finally {
|
||||
// Clean up
|
||||
tempOutputFile.delete()
|
||||
@ -401,9 +404,9 @@ class EncryptedFileSystemRepositoryTest {
|
||||
|
||||
// Assert
|
||||
try {
|
||||
assert exportedBytes == plainBytes[offset..<(offset + length)] as byte[]
|
||||
assert exportedBytes.length == length
|
||||
assert bytesWritten == length
|
||||
assertArrayEquals(plainBytes[offset..<(offset + length)] as byte[], exportedBytes)
|
||||
assertEquals(length, exportedBytes.length)
|
||||
assertEquals(length, bytesWritten)
|
||||
} finally {
|
||||
// Clean up
|
||||
tempOutputFile.delete()
|
||||
@ -431,12 +434,12 @@ class EncryptedFileSystemRepositoryTest {
|
||||
logger.info("Cloned claim ${claim} to ${clonedClaim}")
|
||||
|
||||
// Use the EFSR to decrypt the original claim content
|
||||
def retrievedOriginalBytes = verifyClaimDecryption(claim, plainBytes)
|
||||
assert retrievedOriginalBytes == plainBytes
|
||||
byte [] retrievedOriginalBytes = verifyClaimDecryption(claim, plainBytes)
|
||||
assertArrayEquals(plainBytes, retrievedOriginalBytes)
|
||||
|
||||
// Use the EFSR to decrypt the cloned claim content
|
||||
def retrievedClonedBytes = verifyClaimDecryption(clonedClaim, plainBytes)
|
||||
assert retrievedClonedBytes == plainBytes
|
||||
byte [] retrievedClonedBytes = verifyClaimDecryption(clonedClaim, plainBytes)
|
||||
assertArrayEquals(plainBytes, retrievedClonedBytes)
|
||||
}
|
||||
|
||||
/**
|
||||
@ -475,7 +478,9 @@ class EncryptedFileSystemRepositoryTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* Simple test to merge encrypted content claims and ensure that the merged encryption metadata accurately reflects the new claim and allows for decryption, including the header, demarcator, and footer.
|
||||
* Simple test to merge encrypted content claims and ensure that the merged encryption
|
||||
* metadata accurately reflects the new claim and allows for decryption,
|
||||
* including the header, demarcator, and footer.
|
||||
*/
|
||||
@Test
|
||||
void testMergeWithMarkersShouldUpdateEncryptionMetadata() {
|
||||
@ -549,7 +554,7 @@ class EncryptedFileSystemRepositoryTest {
|
||||
logger.info("Read ${description} bytes via repository (${retrievedBytes.length}): ${pba(retrievedBytes)}")
|
||||
|
||||
// Assert
|
||||
assert retrievedBytes == plainBytes
|
||||
assertArrayEquals(plainBytes, retrievedBytes)
|
||||
return retrievedBytes
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,10 @@ import org.slf4j.LoggerFactory
|
||||
|
||||
import static groovy.test.GroovyAssert.shouldFail
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue
|
||||
|
||||
class FlowFromDOMFactoryTest {
|
||||
private static final Logger logger = LoggerFactory.getLogger(FlowFromDOMFactoryTest.class)
|
||||
|
||||
@ -48,7 +52,7 @@ class FlowFromDOMFactoryTest {
|
||||
logger.info("Recovered: ${recovered}")
|
||||
|
||||
// Assert
|
||||
assert property == recovered
|
||||
assertEquals(property, recovered)
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -60,14 +64,13 @@ class FlowFromDOMFactoryTest {
|
||||
PropertyEncryptor flowEncryptor = createExceptionEncryptor()
|
||||
|
||||
// Act
|
||||
def msg = shouldFail(EncryptionException) {
|
||||
String recovered = FlowFromDOMFactory.decrypt(wrappedProperty, flowEncryptor)
|
||||
logger.info("Recovered: ${recovered}")
|
||||
}
|
||||
logger.expected(msg)
|
||||
EncryptionException ee = assertThrows(EncryptionException.class,
|
||||
() -> FlowFromDOMFactory.decrypt(wrappedProperty, flowEncryptor))
|
||||
logger.expected(ee.getMessage())
|
||||
|
||||
// Assert
|
||||
assert msg.message =~ "Check that the nifi.sensitive.props.key value in nifi.properties matches the value used to encrypt the flow.xml.gz file"
|
||||
assertTrue(ee.getMessage().contains("Check that the nifi.sensitive.props.key value " +
|
||||
"in nifi.properties matches the value used to encrypt the flow.xml.gz file"))
|
||||
}
|
||||
|
||||
private PropertyEncryptor createEncryptor() {
|
||||
|
@ -30,7 +30,10 @@ import org.slf4j.LoggerFactory
|
||||
|
||||
import java.security.Security
|
||||
|
||||
class FingerprintFactoryGroovyIT extends GroovyTestCase {
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue
|
||||
|
||||
class FingerprintFactoryGroovyIT {
|
||||
private static final Logger logger = LoggerFactory.getLogger(FingerprintFactoryGroovyIT.class)
|
||||
|
||||
private static PropertyEncryptor mockEncryptor = [
|
||||
@ -81,7 +84,7 @@ class FingerprintFactoryGroovyIT extends GroovyTestCase {
|
||||
FingerprintFactory fingerprintFactory =
|
||||
new FingerprintFactory(mockEncryptor, extensionManager, mockSensitiveValueEncoder)
|
||||
|
||||
def results = []
|
||||
List<String> results = []
|
||||
def resultDurations = []
|
||||
|
||||
// Act
|
||||
@ -105,15 +108,15 @@ class FingerprintFactoryGroovyIT extends GroovyTestCase {
|
||||
|
||||
// Assert
|
||||
final long MAX_DURATION_NANOS = 1_000_000_000 // 1 second
|
||||
assert resultDurations.max() <= MAX_DURATION_NANOS * 2
|
||||
assert resultDurations.sum() / testIterations < MAX_DURATION_NANOS
|
||||
assertTrue(resultDurations.max() <= MAX_DURATION_NANOS * 2)
|
||||
assertTrue(resultDurations.sum() / testIterations < MAX_DURATION_NANOS)
|
||||
|
||||
// Assert the fingerprint does not contain the password
|
||||
results.each { String fingerprint ->
|
||||
assert !(fingerprint =~ "originalPlaintextPassword")
|
||||
results.forEach(fingerprint -> {
|
||||
assertFalse(fingerprint.contains("originalPlaintextPassword"))
|
||||
def maskedValue = (fingerprint =~ /\[MASKED\] \([\w\/\+=]+\)/)
|
||||
assert maskedValue
|
||||
assertTrue(maskedValue.find())
|
||||
logger.info("Masked value: ${maskedValue[0]}")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -22,9 +22,7 @@ import org.apache.nifi.nar.ExtensionManager
|
||||
import org.apache.nifi.nar.StandardExtensionDiscoveringManager
|
||||
import org.apache.nifi.util.NiFiProperties
|
||||
import org.bouncycastle.jce.provider.BouncyCastleProvider
|
||||
import org.junit.jupiter.api.AfterEach
|
||||
import org.junit.jupiter.api.AfterAll
|
||||
import org.junit.jupiter.api.BeforeEach
|
||||
import org.junit.jupiter.api.BeforeAll
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.slf4j.Logger
|
||||
@ -32,7 +30,10 @@ import org.slf4j.LoggerFactory
|
||||
|
||||
import java.security.Security
|
||||
|
||||
class FingerprintFactoryGroovyTest extends GroovyTestCase {
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue
|
||||
|
||||
class FingerprintFactoryGroovyTest {
|
||||
private static final Logger logger = LoggerFactory.getLogger(FingerprintFactoryGroovyTest.class)
|
||||
|
||||
private static PropertyEncryptor mockEncryptor = [
|
||||
@ -83,11 +84,10 @@ class FingerprintFactoryGroovyTest extends GroovyTestCase {
|
||||
logger.info("Generated flow fingerprint: ${fingerprint}")
|
||||
|
||||
// Assert
|
||||
|
||||
// Assert the fingerprint does not contain the password
|
||||
assert !(fingerprint =~ "originalPlaintextPassword")
|
||||
assertFalse(fingerprint.contains("originalPlaintextPassword"))
|
||||
def maskedValue = (fingerprint =~ /\[MASKED\] \([\w\/\+=]+\)/)
|
||||
assert maskedValue
|
||||
assertTrue(maskedValue.find())
|
||||
logger.info("Masked value: ${maskedValue[0]}")
|
||||
}
|
||||
}
|
||||
|
@ -44,6 +44,7 @@ import org.wali.SerDe
|
||||
import org.wali.SerDeFactory
|
||||
import org.wali.SingletonSerDeFactory
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue
|
||||
|
||||
@ -151,11 +152,11 @@ class EncryptedSequentialAccessWriteAheadLogTest {
|
||||
final Collection<SerializedRepositoryRecord> recovered = recoveryRepo.recoverRecords()
|
||||
|
||||
// Ensure that the same records are returned (order is not guaranteed)
|
||||
assert recovered.size() == records.size()
|
||||
assert recovered.every { it.type == RepositoryRecordType.CREATE }
|
||||
assertEquals(records.size(), recovered.size())
|
||||
recovered.forEach(it -> assertEquals(RepositoryRecordType.CREATE, it.type))
|
||||
|
||||
// Check that all attributes (flowfile record) in the recovered records were present in the original list
|
||||
assert recovered.every { (it as SerializedRepositoryRecord).getFlowFileRecord() in records*.getFlowFileRecord() }
|
||||
recovered.forEach(it -> assertTrue(it.getFlowFileRecord() in records*.getFlowFileRecord()))
|
||||
}
|
||||
|
||||
/** This test creates flowfile records, adds them to the repository, and then recovers them to ensure they were persisted */
|
||||
@ -182,8 +183,8 @@ class EncryptedSequentialAccessWriteAheadLogTest {
|
||||
final Collection<SerializedRepositoryRecord> recovered = recoveryRepo.recoverRecords()
|
||||
|
||||
// Ensure that the same records (except now UPDATE instead of CREATE) are returned (order is not guaranteed)
|
||||
assert recovered.size() == records.size()
|
||||
assert recovered.every { it.type == RepositoryRecordType.CREATE }
|
||||
assertEquals(records.size(), recovered.size())
|
||||
recovered.forEach(it -> assertEquals( RepositoryRecordType.CREATE, it.type))
|
||||
}
|
||||
|
||||
private EncryptedSchemaRepositoryRecordSerde buildEncryptedSerDe() {
|
||||
|
@ -26,6 +26,7 @@ import java.time.ZoneOffset;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
@ -83,7 +84,7 @@ public class VolatileComponentStatusRepositoryForComponentsTest {
|
||||
|
||||
private void testFilterDatesReturnAll(VolatileComponentStatusRepository repo) {
|
||||
List<Date> dates = repo.filterDates(null, null, Integer.MAX_VALUE);
|
||||
assert repo.timestamps != null;
|
||||
assertNotNull(repo.timestamps);
|
||||
assertEquals(repo.timestamps.getSize(), dates.size());
|
||||
assertEquals(dates, repo.timestamps.asList());
|
||||
repo.timestamps.add(new Date());
|
||||
|
@ -33,6 +33,8 @@ import javax.net.ssl.SSLContext
|
||||
import javax.net.ssl.SSLServerSocket
|
||||
import java.security.Security
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertArrayEquals
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue
|
||||
|
||||
class SocketRemoteSiteListenerTest {
|
||||
@ -94,11 +96,11 @@ class SocketRemoteSiteListenerTest {
|
||||
* @param enabledProtocols the actual protocols, either in {@code String[]} or {@code Collection<String>} form
|
||||
* @param expectedProtocols the specific protocol versions to be present (ordered as desired)
|
||||
*/
|
||||
void assertProtocolVersions(def enabledProtocols, def expectedProtocols) {
|
||||
static void assertProtocolVersions(def enabledProtocols, def expectedProtocols) {
|
||||
if (TlsConfiguration.getJavaVersion() > 8) {
|
||||
assert enabledProtocols == expectedProtocols as String[]
|
||||
assertArrayEquals(expectedProtocols as String[], enabledProtocols)
|
||||
} else {
|
||||
assert enabledProtocols as Set == expectedProtocols as Set
|
||||
assertEquals(expectedProtocols as Set, enabledProtocols as Set)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -24,6 +24,9 @@ import org.junit.jupiter.api.Test
|
||||
import org.slf4j.Logger
|
||||
import org.slf4j.LoggerFactory
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue
|
||||
|
||||
class HostHeaderHandlerTest {
|
||||
private static final Logger logger = LoggerFactory.getLogger(HostHeaderHandlerTest.class)
|
||||
|
||||
@ -61,8 +64,8 @@ class HostHeaderHandlerTest {
|
||||
logger.info("Handler: ${handler}")
|
||||
|
||||
// Assert
|
||||
assert handler.hostHeaderIsValid(hostname)
|
||||
assert handler.hostHeaderIsValid("${hostname}:${port}")
|
||||
assertTrue(handler.hostHeaderIsValid(hostname))
|
||||
assertTrue(handler.hostHeaderIsValid("${hostname}:${port}"))
|
||||
}
|
||||
|
||||
/**
|
||||
@ -83,7 +86,7 @@ class HostHeaderHandlerTest {
|
||||
// Assert
|
||||
DEFAULT_HOSTS_AND_PORTS_1_5_0.each { String host ->
|
||||
logger.debug("Validating ${host}")
|
||||
assert handler.hostHeaderIsValid(host)
|
||||
assertTrue(handler.hostHeaderIsValid(host))
|
||||
}
|
||||
}
|
||||
|
||||
@ -108,7 +111,7 @@ class HostHeaderHandlerTest {
|
||||
// Assert
|
||||
DEFAULT_HOSTS_AND_PORTS.each { String host ->
|
||||
logger.debug("Validating ${host}")
|
||||
assert handler.hostHeaderIsValid(host)
|
||||
assertTrue(handler.hostHeaderIsValid(host))
|
||||
}
|
||||
}
|
||||
|
||||
@ -138,13 +141,13 @@ class HostHeaderHandlerTest {
|
||||
logger.info("Parsed custom hostnames: ${customHostnames}")
|
||||
|
||||
// Assert
|
||||
assert customHostnames.size() == otherHosts.size() + 2 // Two provided hostnames had ports
|
||||
assertEquals(otherHosts.size() + 2, customHostnames.size()) // Two provided hostnames had ports
|
||||
otherHosts.each { String host ->
|
||||
logger.debug("Checking ${host}")
|
||||
assert customHostnames.contains(host)
|
||||
assertTrue(customHostnames.contains(host))
|
||||
String portlessHost = "${host.split(":", 2)[0]}".toString()
|
||||
logger.debug("Checking ${portlessHost}")
|
||||
assert customHostnames.contains(portlessHost)
|
||||
assertTrue(customHostnames.contains(portlessHost))
|
||||
}
|
||||
}
|
||||
|
||||
@ -187,10 +190,10 @@ class HostHeaderHandlerTest {
|
||||
logger.info("Parsed custom hostnames: ${customHostnames}")
|
||||
|
||||
// Assert
|
||||
assert customHostnames.size() == ipv6Hosts.size()
|
||||
assertEquals(ipv6Hosts.size(), customHostnames.size())
|
||||
ipv6Hosts.each { String host ->
|
||||
logger.debug("Checking ${host}")
|
||||
assert customHostnames.contains(host)
|
||||
assertTrue(customHostnames.contains(host))
|
||||
}
|
||||
}
|
||||
|
||||
@ -233,13 +236,13 @@ class HostHeaderHandlerTest {
|
||||
logger.info("Parsed custom hostnames: ${customHostnames}")
|
||||
|
||||
// Assert
|
||||
assert customHostnames.size() == ipv6Hosts.size() * 2
|
||||
assertEquals(ipv6Hosts.size() * 2, customHostnames.size())
|
||||
ipv6Hosts.each { String host ->
|
||||
logger.debug("Checking ${host}")
|
||||
assert customHostnames.contains(host)
|
||||
assertTrue(customHostnames.contains(host))
|
||||
String portlessHost = "${StringUtils.substringBeforeLast(host, ":")}".toString()
|
||||
logger.debug("Checking ${portlessHost}")
|
||||
assert customHostnames.contains(portlessHost)
|
||||
assertTrue(customHostnames.contains(portlessHost))
|
||||
}
|
||||
}
|
||||
|
||||
@ -269,6 +272,6 @@ class HostHeaderHandlerTest {
|
||||
}
|
||||
|
||||
// Assert
|
||||
assert hostsAreIPv6.every()
|
||||
hostsAreIPv6.forEach(hostIsIPv6 -> assertTrue(hostIsIPv6))
|
||||
}
|
||||
}
|
||||
|
@ -34,6 +34,7 @@ import static org.apache.nifi.web.util.WebUtils.FORWARDED_PORT_HTTP_HEADER
|
||||
import static org.apache.nifi.web.util.WebUtils.FORWARDED_PREFIX_HTTP_HEADER
|
||||
import static org.apache.nifi.web.util.WebUtils.FORWARDED_PROTO_HTTP_HEADER
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows
|
||||
|
||||
class ApplicationResourceTest {
|
||||
@ -100,10 +101,10 @@ class ApplicationResourceTest {
|
||||
ApplicationResource resource = buildApplicationResource()
|
||||
NiFiProperties niFiProperties = new NiFiProperties([(PROXY_CONTEXT_PATH_PROP): ALLOWED_PATH] as Properties)
|
||||
resource.properties = niFiProperties
|
||||
|
||||
String expectedUri = "https://nifi.apache.org:8081" + ALLOWED_PATH + "/actualResource"
|
||||
String generatedUri = resource.generateResourceUri('actualResource')
|
||||
|
||||
assert generatedUri == "https://nifi.apache.org:8081${ALLOWED_PATH}/actualResource"
|
||||
assertEquals(expectedUri, generatedUri)
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -112,10 +113,10 @@ class ApplicationResourceTest {
|
||||
String multipleAllowedPaths = [ALLOWED_PATH, "another/path", "a/third/path"].join(",")
|
||||
NiFiProperties niFiProperties = new NiFiProperties([(PROXY_CONTEXT_PATH_PROP): multipleAllowedPaths] as Properties)
|
||||
resource.properties = niFiProperties
|
||||
|
||||
String expectedUri = "https://nifi.apache.org:8081" + ALLOWED_PATH + "/actualResource"
|
||||
String generatedUri = resource.generateResourceUri('actualResource')
|
||||
|
||||
assert generatedUri == "https://nifi.apache.org:8081${ALLOWED_PATH}/actualResource"
|
||||
assertEquals(expectedUri, generatedUri)
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -137,9 +138,10 @@ class ApplicationResourceTest {
|
||||
ApplicationResource resource = buildApplicationResource([FORWARDED_CONTEXT_HTTP_HEADER])
|
||||
NiFiProperties niFiProperties = new NiFiProperties([(PROXY_CONTEXT_PATH_PROP): ALLOWED_PATH] as Properties)
|
||||
resource.properties = niFiProperties
|
||||
|
||||
String expectedUri = "https://nifi.apache.org:8081" + ALLOWED_PATH + "/actualResource"
|
||||
String generatedUri = resource.generateResourceUri('actualResource')
|
||||
assert generatedUri == "https://nifi.apache.org:8081${ALLOWED_PATH}/actualResource"
|
||||
|
||||
assertEquals(expectedUri, generatedUri)
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -147,9 +149,10 @@ class ApplicationResourceTest {
|
||||
ApplicationResource resource = buildApplicationResource([FORWARDED_PREFIX_HTTP_HEADER])
|
||||
NiFiProperties niFiProperties = new NiFiProperties([(PROXY_CONTEXT_PATH_PROP): ALLOWED_PATH] as Properties)
|
||||
resource.properties = niFiProperties
|
||||
|
||||
String expectedUri = "https://nifi.apache.org:8081" + ALLOWED_PATH + "/actualResource"
|
||||
String generatedUri = resource.generateResourceUri('actualResource')
|
||||
assert generatedUri == "https://nifi.apache.org:8081${ALLOWED_PATH}/actualResource"
|
||||
|
||||
assertEquals(expectedUri, generatedUri)
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -158,9 +161,10 @@ class ApplicationResourceTest {
|
||||
String multipleAllowedPaths = [ALLOWED_PATH, "another/path", "a/third/path"].join(",")
|
||||
NiFiProperties niFiProperties = new NiFiProperties([(PROXY_CONTEXT_PATH_PROP): multipleAllowedPaths] as Properties)
|
||||
resource.properties = niFiProperties
|
||||
|
||||
String expectedUri = "https://nifi.apache.org:8081" + ALLOWED_PATH + "/actualResource"
|
||||
String generatedUri = resource.generateResourceUri('actualResource')
|
||||
assert generatedUri == "https://nifi.apache.org:8081${ALLOWED_PATH}/actualResource"
|
||||
|
||||
assertEquals(expectedUri, generatedUri)
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -169,8 +173,9 @@ class ApplicationResourceTest {
|
||||
String multipleAllowedPaths = [ALLOWED_PATH, "another/path", "a/third/path"].join(",")
|
||||
NiFiProperties niFiProperties = new NiFiProperties([(PROXY_CONTEXT_PATH_PROP): multipleAllowedPaths] as Properties)
|
||||
resource.properties = niFiProperties
|
||||
|
||||
String expectedUri = "https://nifi.apache.org:8081" + ALLOWED_PATH + "/actualResource"
|
||||
String generatedUri = resource.generateResourceUri('actualResource')
|
||||
assert generatedUri == "https://nifi.apache.org:8081${ALLOWED_PATH}/actualResource"
|
||||
|
||||
assertEquals(expectedUri, generatedUri)
|
||||
}
|
||||
}
|
||||
|
@ -31,6 +31,9 @@ import javax.servlet.http.HttpServletRequest
|
||||
import javax.ws.rs.core.Response
|
||||
import javax.ws.rs.core.UriInfo
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse
|
||||
|
||||
class ProcessGroupResourceTest {
|
||||
private static final Logger logger = LoggerFactory.getLogger(ProcessGroupResourceTest.class)
|
||||
|
||||
@ -67,12 +70,12 @@ class ProcessGroupResourceTest {
|
||||
// Assert
|
||||
|
||||
// Assert that the expected error response was returned
|
||||
assert response.status == Response.Status.OK.statusCode
|
||||
assertEquals(Response.Status.OK.statusCode, response.status)
|
||||
|
||||
// Assert that the error response is sanitized
|
||||
String responseEntity = response.entity as String
|
||||
logger.info("Error response: ${responseEntity}")
|
||||
assert !(responseEntity =~ /<script.*>/)
|
||||
assertFalse((responseEntity =~ /<script.*>/).find())
|
||||
}
|
||||
|
||||
/** This test creates a malformed template import request to exercise error handling and sanitization */
|
||||
@ -143,12 +146,12 @@ class ProcessGroupResourceTest {
|
||||
// Assert
|
||||
responses.each { Response r ->
|
||||
// Assert that the expected error response was returned
|
||||
assert r.status == Response.Status.OK.statusCode
|
||||
assertEquals(Response.Status.OK.statusCode, r.status)
|
||||
|
||||
// Assert that the error response is sanitized
|
||||
String entity = r.entity as String
|
||||
logger.info("Error response: ${entity}")
|
||||
assert !(entity =~ /<script.*>/)
|
||||
assertFalse((entity =~ /<script.*>/).find())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,10 @@ import org.slf4j.LoggerFactory
|
||||
|
||||
import javax.ws.rs.core.Response
|
||||
|
||||
class JsonContentConversionExceptionMapperTest extends GroovyTestCase {
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse
|
||||
|
||||
class JsonContentConversionExceptionMapperTest {
|
||||
private static final Logger logger = LoggerFactory.getLogger(ProcessGroupResourceTest.class)
|
||||
|
||||
@BeforeAll
|
||||
@ -57,8 +60,10 @@ class JsonContentConversionExceptionMapperTest extends GroovyTestCase {
|
||||
logger.info(response.toString())
|
||||
|
||||
// Assert
|
||||
assert response.status == Response.Status.BAD_REQUEST.statusCode
|
||||
assert response.entity == "The provided proxyPort value \'thisIsAnInvalidPort\' is not of required type class java.lang.Integer"
|
||||
assertEquals(Response.Status.BAD_REQUEST.statusCode, response.status)
|
||||
String expectedEntity = "The provided proxyPort value 'thisIsAnInvalidPort' is not" +
|
||||
" of required type class java.lang.Integer"
|
||||
assertEquals(expectedEntity, response.entity)
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -80,7 +85,7 @@ class JsonContentConversionExceptionMapperTest extends GroovyTestCase {
|
||||
logger.info(response.toString())
|
||||
|
||||
// Assert
|
||||
assert response.status == Response.Status.BAD_REQUEST.statusCode
|
||||
assert !(response.entity =~ /<script.*>/)
|
||||
assertEquals(Response.Status.BAD_REQUEST.statusCode, response.status)
|
||||
assertFalse((response.entity =~ /<script.*>/).find())
|
||||
}
|
||||
}
|
||||
|
@ -31,6 +31,8 @@ import javax.servlet.ServletResponse
|
||||
import javax.servlet.http.HttpServletRequest
|
||||
import javax.servlet.http.HttpServletResponse
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals
|
||||
|
||||
class CatchAllFilterTest {
|
||||
private static final Logger logger = LoggerFactory.getLogger(CatchAllFilterTest.class)
|
||||
|
||||
@ -67,7 +69,7 @@ class CatchAllFilterTest {
|
||||
logger.info("Allowed context paths: ${caf.getAllowedContextPaths()}")
|
||||
|
||||
// Assert
|
||||
assert caf.getAllowedContextPaths() == EXPECTED_ALLOWED_CONTEXT_PATHS
|
||||
assertEquals(EXPECTED_ALLOWED_CONTEXT_PATHS, caf.getAllowedContextPaths())
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -128,6 +130,6 @@ class CatchAllFilterTest {
|
||||
caf.doFilter(mockRequest, mockResponse, mockFilterChain)
|
||||
|
||||
// Assert
|
||||
assert forwardedRequestTo == EXPECTED_FORWARD_PATH
|
||||
assertEquals(EXPECTED_FORWARD_PATH, forwardedRequestTo)
|
||||
}
|
||||
}
|
||||
|
@ -50,6 +50,7 @@ import java.util.Set;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
@DisabledOnOs(OS.WINDOWS) //The pretty printed json comparisons dont work on windows
|
||||
@ -586,7 +587,7 @@ runner.assertTransferCount(JoltTransformRecord.REL_ORIGINAL, 1);
|
||||
runner.setProperty(writer, "Pretty Print JSON", "true");
|
||||
runner.enableControllerService(writer);
|
||||
URL t = getClass().getResource("/TestJoltTransformRecord/TestCustomJoltTransform.jar");
|
||||
assert t != null;
|
||||
assertNotNull(t);
|
||||
final String customJarPath = t.getPath();
|
||||
final String spec = new String(Files.readAllBytes(Paths.get("src/test/resources/TestJoltTransformRecord/customChainrSpec.json")));
|
||||
final String customJoltTransform = "TestCustomJoltTransform";
|
||||
|
@ -41,8 +41,11 @@ import java.security.KeyManagementException
|
||||
import java.security.Security
|
||||
import java.util.concurrent.atomic.AtomicLong
|
||||
|
||||
import static groovy.test.GroovyAssert.shouldFail
|
||||
import static org.apache.nifi.provenance.TestUtil.createFlowFile
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull
|
||||
import static org.junit.jupiter.api.Assertions.assertNull
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows
|
||||
|
||||
class EncryptedSchemaRecordReaderWriterTest extends AbstractTestRecordReaderWriter {
|
||||
private static final Logger logger = LoggerFactory.getLogger(EncryptedSchemaRecordReaderWriterTest.class)
|
||||
@ -95,15 +98,19 @@ class EncryptedSchemaRecordReaderWriterTest extends AbstractTestRecordReaderWrit
|
||||
}
|
||||
|
||||
private static
|
||||
final FlowFile buildFlowFile(Map attributes = [:], long id = idGenerator.getAndIncrement(), long fileSize = 3000L) {
|
||||
final FlowFile buildFlowFile(Map attributes = [:], long id = idGenerator.getAndIncrement(),
|
||||
long fileSize = 3000L) {
|
||||
if (!attributes?.uuid) {
|
||||
attributes.uuid = UUID.randomUUID().toString()
|
||||
}
|
||||
createFlowFile(id, fileSize, attributes)
|
||||
}
|
||||
|
||||
private
|
||||
static ProvenanceEventRecord buildEventRecord(FlowFile flowfile = buildFlowFile(), ProvenanceEventType eventType = ProvenanceEventType.RECEIVE, String transitUri = TRANSIT_URI, String componentId = COMPONENT_ID, String componentType = PROCESSOR_TYPE, long eventTime = System.currentTimeMillis()) {
|
||||
private static ProvenanceEventRecord buildEventRecord(FlowFile flowfile = buildFlowFile(),
|
||||
ProvenanceEventType eventType = ProvenanceEventType.RECEIVE,
|
||||
String transitUri = TRANSIT_URI, String componentId = COMPONENT_ID,
|
||||
String componentType = PROCESSOR_TYPE,
|
||||
long eventTime = System.currentTimeMillis()) {
|
||||
final ProvenanceEventBuilder builder = new StandardProvenanceEventRecord.Builder()
|
||||
builder.setEventTime(eventTime)
|
||||
builder.setEventType(eventType)
|
||||
@ -164,17 +171,18 @@ class EncryptedSchemaRecordReaderWriterTest extends AbstractTestRecordReaderWrit
|
||||
logger.info("Generated encrypted reader: ${reader}")
|
||||
|
||||
ProvenanceEventRecord encryptedEvent = reader.nextRecord()
|
||||
assert encryptedEvent
|
||||
assert encryptedRecordId as long == encryptedEvent.getEventId()
|
||||
assert record.componentId == encryptedEvent.getComponentId()
|
||||
assert record.componentType == encryptedEvent.getComponentType()
|
||||
assertNotNull(encryptedEvent)
|
||||
assertEquals(encryptedRecordId, encryptedEvent.getEventId())
|
||||
assertEquals(record.componentId, encryptedEvent.getComponentId())
|
||||
assertEquals(record.componentType, encryptedEvent.getComponentType())
|
||||
logger.info("Successfully read encrypted record: ${encryptedEvent}")
|
||||
|
||||
assert !reader.nextRecord()
|
||||
assertNull(reader.nextRecord())
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a record and write it with a standard writer and the encrypted writer to different repositories. Recover with the standard reader and the contents of the encrypted record should be unreadable.
|
||||
* Build a record and write it with a standard writer and the encrypted writer to different repositories.
|
||||
* Recover with the standard reader and the contents of the encrypted record should be unreadable.
|
||||
*/
|
||||
@Test
|
||||
void testShouldWriteEncryptedRecordAndPlainRecord() {
|
||||
@ -213,13 +221,13 @@ class EncryptedSchemaRecordReaderWriterTest extends AbstractTestRecordReaderWrit
|
||||
logger.info("Generated standard reader: ${reader}")
|
||||
|
||||
ProvenanceEventRecord standardEvent = reader.nextRecord()
|
||||
assert standardEvent
|
||||
assert standardRecordId as long == standardEvent.getEventId()
|
||||
assert record.componentId == standardEvent.getComponentId()
|
||||
assert record.componentType == standardEvent.getComponentType()
|
||||
assertNotNull(standardEvent)
|
||||
assertEquals(standardRecordId, standardEvent.getEventId())
|
||||
assertEquals(record.componentId, standardEvent.getComponentId())
|
||||
assertEquals(record.componentType, standardEvent.getComponentType())
|
||||
logger.info("Successfully read standard record: ${standardEvent}")
|
||||
|
||||
assert !reader.nextRecord()
|
||||
assertNull(reader.nextRecord())
|
||||
|
||||
// Demonstrate unable to read from encrypted file with standard reader
|
||||
TocReader incompatibleTocReader = new StandardTocReader(encryptedTocFile)
|
||||
@ -227,6 +235,6 @@ class EncryptedSchemaRecordReaderWriterTest extends AbstractTestRecordReaderWrit
|
||||
RecordReader incompatibleReader = new EventIdFirstSchemaRecordReader(efis, encryptedJournalFile.getName(), incompatibleTocReader, MAX_ATTRIBUTE_SIZE)
|
||||
logger.info("Generated standard reader (attempting to read encrypted file): ${incompatibleReader}")
|
||||
|
||||
shouldFail(EOFException) { incompatibleReader.nextRecord() }
|
||||
assertThrows(EOFException.class, () -> incompatibleReader.nextRecord())
|
||||
}
|
||||
}
|
||||
|
@ -32,6 +32,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
public class TestActionHandlerLookup {
|
||||
|
||||
@ -76,7 +77,7 @@ public class TestActionHandlerLookup {
|
||||
action.setType("ALERT");
|
||||
action.setAttributes(attributes);
|
||||
actionHandlerLookup.execute(null, action, metrics);
|
||||
assert alertHandler.getExecuteContextCalled();
|
||||
assertTrue(alertHandler.getExecuteContextCalled());
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -91,7 +92,7 @@ public class TestActionHandlerLookup {
|
||||
action.setType("LOG");
|
||||
action.setAttributes(attributes);
|
||||
actionHandlerLookup.execute(null, action, metrics);
|
||||
assert logHandler.getExecuteContextCalled();
|
||||
assertTrue(logHandler.getExecuteContextCalled());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -26,6 +26,7 @@ import org.slf4j.Logger
|
||||
import org.slf4j.LoggerFactory
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue
|
||||
|
||||
class ExecuteScriptGroovyTest extends BaseScriptTest {
|
||||
private static final Logger logger = LoggerFactory.getLogger(ExecuteScriptGroovyTest.class)
|
||||
@ -81,7 +82,7 @@ class ExecuteScriptGroovyTest extends BaseScriptTest {
|
||||
|
||||
flowFile.assertAttributeExists("time-updated")
|
||||
flowFile.assertAttributeExists("thread")
|
||||
assert flowFile.getAttribute("thread") =~ SINGLE_POOL_THREAD_PATTERN
|
||||
assertTrue((flowFile.getAttribute("thread") =~ SINGLE_POOL_THREAD_PATTERN).find())
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -104,7 +105,7 @@ class ExecuteScriptGroovyTest extends BaseScriptTest {
|
||||
|
||||
flowFile.assertAttributeExists("time-updated")
|
||||
flowFile.assertAttributeExists("thread")
|
||||
assert flowFile.getAttribute("thread") =~ /pool-\d+-thread-1/
|
||||
assertTrue((flowFile.getAttribute("thread") =~ /pool-\d+-thread-1/).find())
|
||||
}
|
||||
}
|
||||
|
||||
@ -134,7 +135,7 @@ class ExecuteScriptGroovyTest extends BaseScriptTest {
|
||||
|
||||
flowFile.assertAttributeExists("time-updated")
|
||||
flowFile.assertAttributeExists("thread")
|
||||
assert flowFile.getAttribute("thread") =~ /pool-\d+-thread-[1-${POOL_SIZE}]/
|
||||
assertTrue((flowFile.getAttribute("thread") =~ /pool-\d+-thread-[1-${POOL_SIZE}]/).find())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -235,8 +235,9 @@ public class TestEncryptContent {
|
||||
// Other than the round trip, checks that the provided cipher is actually used, inferring it from the ciphertext
|
||||
InputStream ciphertext = new ByteArrayInputStream(flowFile.toByteArray());
|
||||
BCPGInputStream pgpin = new BCPGInputStream(getDecoderStream(ciphertext));
|
||||
assert pgpin.nextPacketTag() == 3;
|
||||
assert ((SymmetricKeyEncSessionPacket) pgpin.readPacket()).getEncAlgorithm() == Integer.valueOf(cipher.getValue());
|
||||
assertEquals(3, pgpin.nextPacketTag());
|
||||
assertEquals(Integer.parseInt(cipher.getValue()),
|
||||
((SymmetricKeyEncSessionPacket) pgpin.readPacket()).getEncAlgorithm());
|
||||
pgpin.close();
|
||||
}
|
||||
}
|
||||
|
@ -213,9 +213,8 @@ public class SSLContextServiceTest {
|
||||
runner.assertValid(service);
|
||||
|
||||
// Act
|
||||
boolean isDeleted = tmpKeystore.delete();
|
||||
assert isDeleted;
|
||||
assert !tmpKeystore.exists();
|
||||
assertTrue(tmpKeystore.delete());
|
||||
assertFalse(tmpKeystore.exists());
|
||||
|
||||
// Manually validate the service (expecting cached result to be returned)
|
||||
final MockProcessContext processContext = (MockProcessContext) runner.getProcessContext();
|
||||
|
Loading…
x
Reference in New Issue
Block a user