So I have managed to create the silliest of test scripts e.g.
module TestRepo where import FixedInstruments repo_test_1 = scenario do jpm <- getParty "JPM" fed <- getParty "FED" submit jpm do create Repo with owner = jpm; regulator = fed ; par = 1.5; cusip = "9999999"
based on this:
module FixedInstruments where template Repo with owner : Party regulator : Party par : Decimal cusip : Text where signatory owner observer regulator
which generated this:
Transactions: TX 0 1970-01-01T00:00:00Z (TestRepo:9:13) #0:0 │ known to (since): 'FED' (0), 'JPM' (0) └─> create FixedInstruments:Repo with owner = 'JPM'; regulator = 'FED'; par = 1.5000000000; cusip = "9999999" Active contracts: #0:0 Return value: #0:0
Yet I’m so used to setting up Spock specs, so again I’m trying to fast track myself to setting up a series of unit test I can auto run in a more common setup.
To do so, it requires that:
I can launch a ledger as part of the before all test setup of the test suite
that respective testing api exists via the Java SDK e.g. getParty, allocateParty , create and so forth
that thru the create cmd I have a means of retrieving an identifying hash for the transaction so that I can then look it up later , in order to setup asserts based on said transaction and therein contained contracts
So my question is do the above requisites exist ? i.e. is all of this part of the JAVA Ledger API ?
Does an example of testing daml via for example Junit exist ?
Finally, I invariably will develop “testing” UIs as I usually do which will include in this case some sort of ledger explorer although perhaps the Navigator will spare me the exercise
the issue there is can somebody pls point me to how I can maintain a local “persisted” daml ledger to assist in this secondary type of testing