Minor: move some test functions for making zips out of the global namespace.

This commit is contained in:
Mike Hearn
2017-07-12 10:37:36 +02:00
committed by Andrius Dagys
parent 6ba3ae870c
commit 2cbdb719c6
3 changed files with 33 additions and 30 deletions

View File

@ -5,6 +5,7 @@ import com.google.common.hash.HashingInputStream
import net.corda.client.rpc.CordaRPCConnection
import net.corda.client.rpc.notUsed
import net.corda.contracts.asset.Cash
import net.corda.core.InputStreamAndHash
import net.corda.core.contracts.DOLLARS
import net.corda.core.contracts.POUNDS
import net.corda.core.contracts.SWISS_FRANCS
@ -16,7 +17,6 @@ import net.corda.core.node.services.Vault
import net.corda.core.node.services.vault.*
import net.corda.core.seconds
import net.corda.core.utilities.OpaqueBytes
import net.corda.core.sizedInputStreamAndHash
import net.corda.core.utilities.loggerFor
import net.corda.flows.CashIssueFlow
import net.corda.flows.CashPaymentFlow
@ -78,7 +78,7 @@ class StandaloneCordaRPClientTest {
@Test
fun `test attachments`() {
val attachment = sizedInputStreamAndHash(attachmentSize)
val attachment = InputStreamAndHash.createInMemoryTestZip(attachmentSize, 1)
assertFalse(rpcProxy.attachmentExists(attachment.sha256))
val id = WrapperStream(attachment.inputStream).use { rpcProxy.uploadAttachment(it) }
assertEquals(attachment.sha256, id, "Attachment has incorrect SHA256 hash")