use of io.cucumber.java.DataTableType in project bluezone by jmgarridopaz.
the class PermitStepDefs method permitRequestEntry.
// @When("I do the following issue permit request at {string}:")
// public void iDoTheFollowingIssuePermitRequestAt ( String aString, PermitRequest permitRequest ) {
// ForParkingCars forParkingCars = this.scenarioContext.systemUnderTest();
// LocalDateTime currentDateTime = LocalDateTime.parse ( aString, DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm") );
// Clock clockWithCurrentDateTime = Clock.fixed ( currentDateTime.toInstant(ZoneOffset.UTC), ZoneOffset.UTC );
// PermitTicket permitTicket = forParkingCars.issuePermit ( clockWithCurrentDateTime, permitRequest );
// this.scenarioContext.setIssuedPermitTicket(permitTicket);
// }
//
//
// @Then("I should get the following issue permit response:")
// public void iShouldGetTheFollowingIssuePermitResponse ( PermitTicket expectedPermitTicket) {
// assertThat ( this.scenarioContext.getIssuedPermitTicket(), is(expectedPermitTicket) );
// }
@DataTableType
public ParkingRequest permitRequestEntry(Map<String, String> dataTableEntry) {
LocalDateTime currentDateTime = LocalDateTime.parse(dataTableEntry.get("current date time"), DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss"));
Clock clockWithCurrentDateTime = Clock.fixed(currentDateTime.toInstant(ZoneOffset.UTC), ZoneOffset.UTC);
LocalDateTime endingDateTime = LocalDateTime.parse(dataTableEntry.get("ending date time"), DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm"));
ParkingRequest permitRequest = new ParkingRequest();
permitRequest.setClock(clockWithCurrentDateTime);
permitRequest.setCarPlate(dataTableEntry.get("car plate"));
permitRequest.setRateName(dataTableEntry.get("rate name"));
permitRequest.setEndingDateTime(endingDateTime);
permitRequest.setPaymentCardNumber(dataTableEntry.get("payment card number"));
return permitRequest;
}
use of io.cucumber.java.DataTableType in project bluezone by jmgarridopaz.
the class PermitStepDefs method permitTicketEntry.
@DataTableType
public PermitTicket permitTicketEntry(Map<String, String> dataTableEntry) {
LocalDateTime startingDateTime = LocalDateTime.parse(dataTableEntry.get("starting date time"), DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm"));
LocalDateTime endingDateTime = LocalDateTime.parse(dataTableEntry.get("ending date time"), DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm"));
PermitTicket permitTicket = new PermitTicket();
permitTicket.setCode(dataTableEntry.get("code"));
permitTicket.setCarPlate(dataTableEntry.get("car plate"));
permitTicket.setStartingDateTime(startingDateTime);
permitTicket.setEndingDateTime(endingDateTime);
permitTicket.setRateName(dataTableEntry.get("rate name"));
permitTicket.setPrice(new BigDecimal(dataTableEntry.get("price")));
return permitTicket;
}
use of io.cucumber.java.DataTableType in project hedera-mirror-node by hashgraph.
the class CustomFeesConverter method customFee.
@DataTableType
public CustomFee customFee(Map<String, String> entry) {
String amount = entry.get("amount");
AccountId collector = tokenFeature.getRecipientAccountId(Integer.parseInt(entry.get("collector")));
if (Strings.isNotEmpty(amount)) {
// fixed fee
CustomFixedFee fixedFee = new CustomFixedFee();
fixedFee.setAmount(Long.parseLong(amount));
fixedFee.setFeeCollectorAccountId(collector);
fixedFee.setDenominatingTokenId(getTokenId(entry.get("token")));
return fixedFee;
} else {
CustomFractionalFee fractionalFee = new CustomFractionalFee();
fractionalFee.setNumerator(Long.parseLong(entry.get("numerator")));
fractionalFee.setDenominator(Long.parseLong(entry.get("denominator")));
fractionalFee.setFeeCollectorAccountId(collector);
fractionalFee.setMax(getValueOrDefault(entry.get("maximum")));
fractionalFee.setMin(getValueOrDefault(entry.get("minimum")));
return fractionalFee;
}
}
use of io.cucumber.java.DataTableType in project hedera-mirror-node by hashgraph.
the class CustomFeesConverter method mirrorAssessedCustomFee.
@DataTableType
public MirrorAssessedCustomFee mirrorAssessedCustomFee(Map<String, String> entry) {
MirrorAssessedCustomFee assessedCustomFee = new MirrorAssessedCustomFee();
assessedCustomFee.setAmount(Long.parseLong(entry.get("amount")));
assessedCustomFee.setCollectorAccountId(tokenFeature.getRecipientAccountId(Integer.parseInt(entry.get("collector"))).toString());
assessedCustomFee.setTokenId(getToken(entry.get("token")));
return assessedCustomFee;
}
use of io.cucumber.java.DataTableType in project bluezone by jmgarridopaz.
the class RateStepDefs method rateEntry.
@DataTableType
public RateData rateEntry(Map<String, String> entry) {
RateData rate = new RateData();
rate.setName(entry.get("name"));
rate.setAmountPerHour(new BigDecimal(entry.get("amount per hour")));
rate.setMinMinutesAllowed(Integer.parseInt(entry.get("min minutes allowed")));
rate.setMaxMinutesAllowed(Integer.parseInt(entry.get("max minutes allowed")));
return rate;
}
Aggregations