mirror of
https://github.com/corda/corda.git
synced 2025-06-22 09:08:49 +00:00
Merge pull request #936 from corda/os-merge-d620e71
O/S merge from d620e71
This commit is contained in:
@ -194,7 +194,7 @@ class MySQLNotaryServiceTests : IntegrationTest() {
|
||||
val transactionCount = 100
|
||||
val results = notaryNode.services.startFlow(RequestGenerationFlow(notaryService, transactionCount)).resultFuture.get()
|
||||
assertEquals(transactionCount, results.size)
|
||||
assert(results.all { it === Result.Success })
|
||||
require(results.all { it === Result.Success })
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -203,7 +203,7 @@ class MySQLNotaryServiceTests : IntegrationTest() {
|
||||
val transactionCount = 10
|
||||
val results = notaryNode.services.startFlow(RequestGenerationFlow(notaryService, transactionCount, 50)).resultFuture.get()
|
||||
assertEquals(transactionCount, results.size)
|
||||
assert(results.all { it === Result.Success })
|
||||
require(results.all { it === Result.Success })
|
||||
}
|
||||
|
||||
private class RequestGenerationFlow(
|
||||
|
@ -87,7 +87,7 @@ class ImmutableClassSerializer<T : Any>(val klass: KClass<T>) : Serializer<T>()
|
||||
// Verify that this class is immutable (all properties are final).
|
||||
// We disable this check inside SGX as the reflection blows up.
|
||||
if (!SgxSupport.isInsideEnclave) {
|
||||
assert(props.none { it is KMutableProperty<*> })
|
||||
require(props.none { it is KMutableProperty<*> })
|
||||
}
|
||||
}
|
||||
|
||||
@ -123,7 +123,7 @@ class ImmutableClassSerializer<T : Any>(val klass: KClass<T>) : Serializer<T>()
|
||||
}
|
||||
|
||||
override fun read(kryo: Kryo, input: Input, type: Class<T>): T {
|
||||
assert(type.kotlin == klass)
|
||||
require(type.kotlin == klass)
|
||||
val numFields = input.readVarInt(true)
|
||||
val fieldTypeHash = input.readInt()
|
||||
|
||||
|
@ -34,6 +34,6 @@ class EnterpriseNodeTest {
|
||||
|
||||
val expectedPattern = if (custom == null) "${expectedName}_London_GB_\\d+_\\d+_\\d+_\\d+" else expectedName
|
||||
val createdName = EnterpriseNode.getGraphitePrefix(nodeConfig)
|
||||
assert(Regex(expectedPattern).matches(createdName), { "${createdName} did not match ${expectedPattern}" })
|
||||
require(Regex(expectedPattern).matches(createdName), { "${createdName} did not match ${expectedPattern}" })
|
||||
}
|
||||
}
|
@ -131,7 +131,7 @@ class RPCSecurityManagerTest {
|
||||
id = AuthServiceId("TEST"))
|
||||
val subject = userRealm.buildSubject("foo")
|
||||
for (action in allActions) {
|
||||
assert(!subject.isPermitted(action)) {
|
||||
require(!subject.isPermitted(action)) {
|
||||
"Invalid subject should not be allowed to call $action"
|
||||
}
|
||||
}
|
||||
@ -153,24 +153,24 @@ class RPCSecurityManagerTest {
|
||||
for (request in permitted) {
|
||||
val call = request.first()
|
||||
val args = request.drop(1).toTypedArray()
|
||||
assert(subject.isPermitted(request.first(), *args)) {
|
||||
require(subject.isPermitted(request.first(), *args)) {
|
||||
"User ${subject.principal} should be permitted $call with target '${request.toList()}'"
|
||||
}
|
||||
if (args.isEmpty()) {
|
||||
assert(subject.isPermitted(request.first(), "XXX")) {
|
||||
require(subject.isPermitted(request.first(), "XXX")) {
|
||||
"User ${subject.principal} should be permitted $call with any target"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
disabled.forEach {
|
||||
assert(!subject.isPermitted(it)) {
|
||||
require(!subject.isPermitted(it)) {
|
||||
"Permissions $permissions should not allow to call $it"
|
||||
}
|
||||
}
|
||||
|
||||
disabled.filter { !permitted.contains(listOf(it, "foo")) }.forEach {
|
||||
assert(!subject.isPermitted(it, "foo")) {
|
||||
require(!subject.isPermitted(it, "foo")) {
|
||||
"Permissions $permissions should not allow to call $it with argument 'foo'"
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user