google-nomulus/javatests/google/registry
jianglai ff221fba96 Validate individual fee types
Currently we validate the fee extension by summing up all fees present in the extension and comparing it against the total fee to be charged. While this works in most cases, we'd like the ability to individually validate each fee. This is especially useful during EAP when two fees are charged, a regular "create" fee that would also be amount we charge during renewal, and a one time "EAP" fee.

Because we can only distinguish fees by their descriptions, we try to match the description to the format string of the fee type enums. We also only require individual fee matches when we are charging more than one type of fees, which makes the change compatible with most existing use cases where only one fees is charged and the description field is ignored in the extension.

We expect the workflow to be that a registrar sends a domain check, and we reply with exactly what fees we are expecting, and then it will use the descriptions in the response to send us a domain create with the correct fees.

Note that we aggregate fees within the same FeeType together. Normally there will only be one fee per type, but in case of custom logic there could be more than one fee for the same type. There is no way to distinguish them as they both use the same description. So it is simpler to just aggregate them.

This CL also includes some reformatting that conforms to google-java-format output.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=186530316
2018-03-06 18:48:39 -05:00
..
backup Rationalize logging statements across codebase 2018-01-19 14:56:45 -05:00
batch Migrate final try/catch test assertions to use assert/expectThrows 2018-01-19 14:43:12 -05:00
beam Move invoice generation to billing bucket and improve emailing 2018-01-19 14:34:14 -05:00
bigquery Automatically refactor more exception testing to use new JUnit rules 2017-12-27 10:42:36 -05:00
builddefs Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
config Remove more unused Truth8.assertThat() static imports in tests 2017-11-07 17:22:56 -05:00
cron Automatically refactor more exception testing to use new JUnit rules 2017-12-27 10:42:36 -05:00
dns Add metric for DNS UPDATE latency 2018-02-20 15:54:15 -05:00
export Migrate final try/catch test assertions to use assert/expectThrows 2018-01-19 14:43:12 -05:00
flows Validate individual fee types 2018-03-06 18:48:39 -05:00
groups Use method references when possible 2017-12-27 11:25:02 -05:00
keyring Move backported JUnit file to third_party (part 2) 2017-12-02 11:37:46 -05:00
mapreduce/inputs Migrate final try/catch test assertions to use assert/expectThrows 2018-01-19 14:43:12 -05:00
model Add the START_DATE_SUNRISE phase 2018-02-20 15:45:27 -05:00
module Refactor ICANN reporting and billing into common package 2018-02-01 21:56:06 -05:00
monitoring/whitebox Add dependencies on classes that are not in the default modules in JDK 9 2018-02-01 22:00:49 -05:00
pricing Automatically refactor more exception testing to use new JUnit rules 2017-12-27 10:42:36 -05:00
proxy Make SSL failure test more robust 2018-02-20 15:59:06 -05:00
rdap RDAP: Change data policy remark for redacted contacts 2018-02-20 15:33:31 -05:00
rde Respect system TMPDIR in GPG related tests 2018-02-20 15:57:41 -05:00
reporting Refactor ICANN reporting and billing into common package 2018-02-01 21:56:06 -05:00
request Remove unnecessary type specifications 2017-12-27 11:23:03 -05:00
security Remove more unused Truth8.assertThat() static imports in tests 2017-11-07 17:22:56 -05:00
server Move backported JUnit file to third_party (part 2) 2017-12-02 11:37:46 -05:00
storage/drive Remove unnecessary type specifications 2017-12-27 11:23:03 -05:00
testing Respect system TMPDIR in GPG related tests 2018-02-20 15:57:41 -05:00
tldconfig/idn Remove unnecessary type specifications 2017-12-27 11:23:03 -05:00
tmch Use method references instead of lambdas when possible 2017-12-27 10:55:03 -05:00
tools Delete obsolete billing code 2018-02-20 15:09:45 -05:00
ui Replace uses of @code in Javascript documentation with Markdown backticks 2018-02-05 23:51:49 -05:00
util Replace com.google.common.base.Function with java.util.function.Function 2017-12-27 11:08:55 -05:00
whois Migrate final try/catch test assertions to use assert/expectThrows 2018-01-19 14:43:12 -05:00
xjc Automatically refactor more exception testing to use new JUnit rules 2017-12-27 10:42:36 -05:00
xml Add basic AllocationToken validation/redemption for domain creates 2018-01-19 14:28:26 -05:00