forked from hyperledger-archives/composer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1754 Increase query test coverage for composer REST Server and #1705… (
hyperledger-archives#2101) * #1754 Increase query test coverage for composer REST Server and #1705 fix datetime in rest * keep the datetime value as it is for a clarification * update the test case for querying non-existing value * update the test case for querying a valid endpoint with invalid data * update test case with an unsupported type
- Loading branch information
1 parent
4608d4a
commit c384f85
Showing
4 changed files
with
312 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 64 additions & 4 deletions
68
packages/composer-rest-server/test/data/bond-network/queries.qry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,76 @@ | ||
query findBondByFaceAmount { | ||
query findBondAboveAFaceAmount { | ||
description: "Find all bonds with a face amount greater than _$faceAmount" | ||
statement: SELECT org.acme.bond.BondAsset WHERE (bond.faceAmount > _$faceAmount) | ||
} | ||
query findBondByFaceAmountNotAboveAValue { | ||
description: "Find all bonds with a face amount not greater than _$faceAmount" | ||
statement: SELECT org.acme.bond.BondAsset WHERE(_$faceAmount>=bond.faceAmount) | ||
} | ||
query findBondByDayCount { | ||
description: "Find all bonds with a specific day count _$dayCount" | ||
statement: SELECT org.acme.bond.BondAsset WHERE(bond.dayCount==_$dayCount) | ||
} | ||
query findBondAboveDayCount { | ||
description: "Find all bonds with day count greater than _$dayCount" | ||
statement: SELECT org.acme.bond.BondAsset WHERE(bond.dayCount>_$dayCount) | ||
} | ||
query findBondLessThanDayCount { | ||
description: "Find all bonds with day count less than _$dayCount" | ||
statement: SELECT org.acme.bond.BondAsset WHERE(bond.dayCount<_$dayCount) | ||
} | ||
query findBondByPaymentFrequencyPeriod { | ||
description: "Find all bonds with a payment frequecy period _$period" | ||
statement: SELECT org.acme.bond.BondAsset WHERE (bond.paymentFrequency.period == _$period) | ||
} | ||
query findBondByPaymentFrequencyPeriodMultiplier { | ||
description: "Find all bonds with a payment frequecy period multiplier _$multiplier" | ||
statement: SELECT org.acme.bond.BondAsset WHERE (bond.paymentFrequency.periodMultiplier == _$multiplier) | ||
query findBondAboveAPaymentFrequencyPeriodMultiplierValue { | ||
description: "Find all bonds with a payment frequecy period multiplier greater than _$multiplier" | ||
statement: SELECT org.acme.bond.BondAsset WHERE (bond.paymentFrequency.periodMultiplier > _$multiplier) | ||
} | ||
query findBondByPaymentFrequencyPeriodMultiplierNotAboveAValue { | ||
description: "Find all bonds with a payment frequecy period multiplier not greater than _$multiplier" | ||
statement: SELECT org.acme.bond.BondAsset WHERE (bond.paymentFrequency.periodMultiplier <= _$multiplier) | ||
} | ||
query findBondByIsMatured { | ||
description: "Find all bonds by isMatured _$isMatured" | ||
statement: SELECT org.acme.bond.BondAsset WHERE (bond.isMatured == _$isMatured) | ||
} | ||
query findBondBeforeMaturity { | ||
description: "Find all bonds before a maturity _$maturity" | ||
statement: SELECT org.acme.bond.BondAsset WHERE (bond.maturity <= _$maturity) | ||
} | ||
query findBondAfterMaturity { | ||
description: "Find all bonds after a maturity _$maturity" | ||
statement: SELECT org.acme.bond.BondAsset WHERE (bond.maturity > _$maturity) | ||
} | ||
query findBondByCurrency { | ||
description: "Find all bonds by a specific currency _$currency" | ||
statement: SELECT org.acme.bond.BondAsset WHERE (bond.currency == _$currency) | ||
} | ||
query findBondByIsMaturedBeforeMaturity { | ||
description: "Find all bonds that are either matured or before a maturity _$maturity" | ||
statement: SELECT org.acme.bond.BondAsset WHERE (bond.isMatured == true OR bond.maturity < _$maturity) | ||
} | ||
query findBondByCurrencyAndDayCount { | ||
description: "Find all bonds by a specific currency _$currency and the number days no more than a specified day" | ||
statement: SELECT org.acme.bond.BondAsset WHERE (bond.currency == _$currency AND bond.dayCount <= _$dayCount) | ||
} | ||
query findBondByCurrencyAndUnsupportedType { | ||
description: "Find all bonds by a specific currency _$currency and an instrumentId" | ||
statement: SELECT org.acme.bond.BondAsset WHERE (bond.currency == _$currency AND bond.instrumentId <= _$instrumentId) | ||
} | ||
query findBondByExchangeIdUnsupported { | ||
description: "Find all bonds with a set of exchange id _$exchangeId is unsupported" | ||
statement: SELECT org.acme.bond.BondAsset WHERE (bond.exchangeId == _$exchangeId) | ||
} | ||
query findIssuerById { | ||
description: "Find all issuer by memberId _$memberId" | ||
statement: SELECT org.acme.bond.Issuer WHERE (memberId == _$memberId) | ||
} | ||
query findIssuerByName { | ||
description: "Find all issuer by name _$name" | ||
statement: SELECT org.acme.bond.Issuer WHERE (name == _$name) | ||
} | ||
query findTxnByTransactionType { | ||
description: "Find all Transaction by transaction type" | ||
statement: SELECT org.hyperledger.composer.system.HistorianRecord WHERE (transactionType == 'PublishBond') | ||
} |
Oops, something went wrong.