net.corda.contracts.testing

## Class VaultFiller

- net.corda.contracts.testing.VaultFiller

-     public class VaultFiller

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static long[]` | `calculateRandomlySizedAmounts(Amount<java.util.Currency> howMuch, int min, int max, java.util.Random rng)`
    `static Vault<net.corda.contracts.asset.Cash.State>` | `fillWithSomeTestCash(ServiceHub $receiver, Amount<java.util.Currency> howMuch, Party outputNotary, int atLeastThisManyStates, int atMostThisManyStates, java.util.Random rng, OpaqueBytes ref, CompositeKey ownedBy, PartyAndReference issuedBy, java.security.KeyPair issuerKey)` Creates a random set of between (by default) 3 and 10 cash states that add up to the given amount and adds them to the vault. This is intended for unit tests. The cash is issued by DUMMY_CASH_ISSUER and owned by the legal identity key from the storage service.
    `static void` | `fillWithSomeTestDeals(ServiceHub $receiver, java.util.List<java.lang.String> dealIds)`
    `static void` | `fillWithSomeTestLinearStates(ServiceHub $receiver, int numberToCreate)`

- - ### Method Detail

    - #### fillWithSomeTestDeals

          public static void fillWithSomeTestDeals(ServiceHub $receiver,
                                                   java.util.List<java.lang.String> dealIds)

    - #### fillWithSomeTestLinearStates

          public static void fillWithSomeTestLinearStates(ServiceHub $receiver,
                                                          int numberToCreate)

    - #### fillWithSomeTestCash

          public static Vault<net.corda.contracts.asset.Cash.State> fillWithSomeTestCash(ServiceHub $receiver,
                                                                                         Amount<java.util.Currency> howMuch,
                                                                                         Party outputNotary,
                                                                                         int atLeastThisManyStates,
                                                                                         int atMostThisManyStates,
                                                                                         java.util.Random rng,
                                                                                         OpaqueBytes ref,
                                                                                         CompositeKey ownedBy,
                                                                                         PartyAndReference issuedBy,
                                                                                         java.security.KeyPair issuerKey)

      Creates a random set of between (by default) 3 and 10 cash states that add up to the given amount and adds them to the vault. This is intended for unit tests. The cash is issued by DUMMY_CASH_ISSUER and owned by the legal identity key from the storage service.

      The service hub needs to provide at least a key management service and a storage service.

      Parameters:
        `outputNotary` - the notary to use for output states. The transaction is NOT signed by this notary.
      Returns:
        a vault object that represents the generated states (it will NOT be the full vault from the service hub!).

    - #### calculateRandomlySizedAmounts

          public static long[] calculateRandomlySizedAmounts(Amount<java.util.Currency> howMuch,
                                                             int min,
                                                             int max,
                                                             java.util.Random rng)