mirror of
https://github.com/google/nomulus.git
synced 2025-07-13 22:45:10 +02:00
Allow third_party/java_src/gtld/ to use :mockito2_for_third_party
In [] a change would have been made to your project that is incompatible with your open source integration. To make sure the open source variant of your project remains working, we have eagerly updated your open source copy to use Mockito 2. This CL integrates that change into []. Please read []and understand the consequences of this change. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=238445356
This commit is contained in:
parent
1a6c068471
commit
202ed9db6a
70 changed files with 200 additions and 199 deletions
|
@ -17,7 +17,6 @@ java_library(
|
|||
"//java/google/registry/util",
|
||||
"//javatests/google/registry/testing",
|
||||
"//javatests/google/registry/testing/mapreduce",
|
||||
"//third_party/java/mockito",
|
||||
"//third_party/objectify:objectify-v4_1",
|
||||
"@com_google_appengine_api_1_0_sdk",
|
||||
"@com_google_appengine_tools_appengine_gcs_client",
|
||||
|
@ -29,6 +28,7 @@ java_library(
|
|||
"@com_google_truth_extensions_truth_java8_extension",
|
||||
"@joda_time",
|
||||
"@junit",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@ java_library(
|
|||
"//java/google/registry/util",
|
||||
"//javatests/google/registry/testing",
|
||||
"//javatests/google/registry/testing/mapreduce",
|
||||
"//third_party/java/mockito",
|
||||
"//third_party/objectify:objectify-v4_1",
|
||||
"@com_google_appengine_api_1_0_sdk",
|
||||
"@com_google_appengine_api_stubs",
|
||||
|
@ -39,6 +38,7 @@ java_library(
|
|||
"@joda_time",
|
||||
"@junit",
|
||||
"@org_joda_money",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@ java_library(
|
|||
deps = [
|
||||
"//java/google/registry/beam",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"@com_google_dagger",
|
||||
"@com_google_guava",
|
||||
"@com_google_truth",
|
||||
|
@ -24,6 +23,7 @@ java_library(
|
|||
"@org_apache_beam_runners_google_cloud_dataflow_java",
|
||||
"@org_apache_beam_sdks_java_core",
|
||||
"@org_apache_beam_sdks_java_io_google_cloud_platform",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@ java_library(
|
|||
"//java/google/registry/beam/invoicing",
|
||||
"//java/google/registry/util",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"@com_google_apis_google_api_services_bigquery",
|
||||
"@com_google_dagger",
|
||||
"@com_google_guava",
|
||||
|
@ -27,6 +26,7 @@ java_library(
|
|||
"@org_apache_beam_runners_google_cloud_dataflow_java",
|
||||
"@org_apache_beam_sdks_java_core",
|
||||
"@org_apache_beam_sdks_java_io_google_cloud_platform",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ java_library(
|
|||
"//java/google/registry/beam/spec11",
|
||||
"//java/google/registry/util",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"@com_google_dagger",
|
||||
"@com_google_guava",
|
||||
"@com_google_truth",
|
||||
|
@ -28,6 +27,7 @@ java_library(
|
|||
"@org_apache_httpcomponents_httpclient",
|
||||
"@org_apache_httpcomponents_httpcore",
|
||||
"@org_json",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@ java_library(
|
|||
"//java/google/registry/bigquery",
|
||||
"//java/google/registry/util",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"@com_google_apis_google_api_services_bigquery",
|
||||
"@com_google_guava",
|
||||
"@com_google_http_client",
|
||||
|
@ -23,6 +22,7 @@ java_library(
|
|||
"@com_google_truth_extensions_truth_java8_extension",
|
||||
"@joda_time",
|
||||
"@junit",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@ java_library(
|
|||
"//java/google/registry/request/lock",
|
||||
"//java/google/registry/util",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"//third_party/objectify:objectify-v4_1",
|
||||
"@com_google_appengine_api_1_0_sdk",
|
||||
"@com_google_appengine_api_stubs",
|
||||
|
@ -33,6 +32,7 @@ java_library(
|
|||
"@javax_servlet_api",
|
||||
"@joda_time",
|
||||
"@junit",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@ java_library(
|
|||
"//java/google/registry/model",
|
||||
"//java/google/registry/util",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"//third_party/objectify:objectify-v4_1",
|
||||
"@com_google_apis_google_api_services_dns",
|
||||
"@com_google_guava",
|
||||
|
@ -23,6 +22,7 @@ java_library(
|
|||
"@com_google_truth_extensions_truth_java8_extension",
|
||||
"@joda_time",
|
||||
"@junit",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ java_library(
|
|||
"//java/google/registry/dns/writer/dnsupdate",
|
||||
"//java/google/registry/model",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"//third_party/objectify:objectify-v4_1",
|
||||
"@com_google_dagger",
|
||||
"@com_google_guava",
|
||||
|
@ -23,6 +22,7 @@ java_library(
|
|||
"@dnsjava",
|
||||
"@joda_time",
|
||||
"@junit",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -27,7 +27,6 @@ java_library(
|
|||
"//java/google/registry/util",
|
||||
"//javatests/google/registry/testing",
|
||||
"//javatests/google/registry/testing/mapreduce",
|
||||
"//third_party/java/mockito",
|
||||
"//third_party/objectify:objectify-v4_1",
|
||||
"@com_google_api_client",
|
||||
"@com_google_apis_google_api_services_bigquery",
|
||||
|
@ -47,6 +46,7 @@ java_library(
|
|||
"@javax_servlet_api",
|
||||
"@joda_time",
|
||||
"@junit",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@ java_library(
|
|||
"//java/google/registry/export/datastore",
|
||||
"//java/google/registry/util",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"@com_google_api_client",
|
||||
"@com_google_guava",
|
||||
"@com_google_http_client",
|
||||
|
@ -24,6 +23,7 @@ java_library(
|
|||
"@com_google_truth_extensions_truth_java8_extension",
|
||||
"@joda_time",
|
||||
"@junit",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@ java_library(
|
|||
"//java/google/registry/export/sheet",
|
||||
"//java/google/registry/model",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"//third_party/objectify:objectify-v4_1",
|
||||
"@com_google_apis_google_api_services_sheets",
|
||||
"@com_google_code_findbugs_jsr305",
|
||||
|
@ -23,6 +22,7 @@ java_library(
|
|||
"@joda_time",
|
||||
"@junit",
|
||||
"@org_joda_money",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -40,7 +40,6 @@ java_library(
|
|||
"//javatests/google/registry/model",
|
||||
"//javatests/google/registry/testing",
|
||||
"//javatests/google/registry/xml",
|
||||
"//third_party/java/mockito",
|
||||
"//third_party/objectify:objectify-v4_1",
|
||||
"@com_google_appengine_api_1_0_sdk",
|
||||
"@com_google_appengine_testing",
|
||||
|
@ -61,6 +60,7 @@ java_library(
|
|||
"@joda_time",
|
||||
"@junit",
|
||||
"@org_joda_money",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@ java_library(
|
|||
deps = [
|
||||
"//java/google/registry/groups",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"@com_google_api_client",
|
||||
"@com_google_apis_google_api_services_admin_directory",
|
||||
"@com_google_apis_google_api_services_groupssettings",
|
||||
|
@ -27,6 +26,7 @@ java_library(
|
|||
"@com_google_truth_extensions_truth_java8_extension",
|
||||
"@javax_servlet_api",
|
||||
"@junit",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@ java_library(
|
|||
deps = [
|
||||
"//java/google/registry/keyring/api",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"@com_google_flogger",
|
||||
"@com_google_flogger_system_backend",
|
||||
"@com_google_guava_testlib",
|
||||
|
@ -21,6 +20,7 @@ java_library(
|
|||
"@com_google_truth_extensions_truth_java8_extension",
|
||||
"@junit",
|
||||
"@org_bouncycastle_bcpg_jdk15on",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@ java_library(
|
|||
"//java/google/registry/model",
|
||||
"//java/google/registry/util",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"//third_party/objectify:objectify-v4_1",
|
||||
"@com_google_api_client",
|
||||
"@com_google_apis_google_api_services_cloudkms",
|
||||
|
@ -32,6 +31,7 @@ java_library(
|
|||
"@junit",
|
||||
"@org_bouncycastle_bcpg_jdk15on",
|
||||
"@org_bouncycastle_bcpkix_jdk15on",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@ java_library(
|
|||
"//java/google/registry/xml",
|
||||
"//javatests/google/registry/testing",
|
||||
"//javatests/google/registry/xml",
|
||||
"//third_party/java/mockito",
|
||||
"//third_party/objectify:objectify-v4_1",
|
||||
"@com_google_appengine_api_1_0_sdk",
|
||||
"@com_google_appengine_testing",
|
||||
|
@ -41,6 +40,7 @@ java_library(
|
|||
"@joda_time",
|
||||
"@junit",
|
||||
"@org_joda_money",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -17,11 +17,11 @@ java_library(
|
|||
"//java/google/registry/module/backend",
|
||||
"//java/google/registry/request",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"@com_google_truth",
|
||||
"@com_google_truth_extensions_truth_java8_extension",
|
||||
"@javax_servlet_api",
|
||||
"@junit",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -17,11 +17,11 @@ java_library(
|
|||
"//java/google/registry/module/frontend",
|
||||
"//java/google/registry/request",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"@com_google_truth",
|
||||
"@com_google_truth_extensions_truth_java8_extension",
|
||||
"@javax_servlet_api",
|
||||
"@junit",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -17,11 +17,11 @@ java_library(
|
|||
"//java/google/registry/module/pubapi",
|
||||
"//java/google/registry/request",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"@com_google_truth",
|
||||
"@com_google_truth_extensions_truth_java8_extension",
|
||||
"@javax_servlet_api",
|
||||
"@junit",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -17,11 +17,11 @@ java_library(
|
|||
"//java/google/registry/module/tools",
|
||||
"//java/google/registry/request",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"@com_google_truth",
|
||||
"@com_google_truth_extensions_truth_java8_extension",
|
||||
"@javax_servlet_api",
|
||||
"@junit",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@ java_library(
|
|||
"//java/google/registry/monitoring/whitebox",
|
||||
"//java/google/registry/util",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"//third_party/objectify:objectify-v4_1",
|
||||
"@com_google_apis_google_api_services_bigquery",
|
||||
"@com_google_appengine_api_1_0_sdk",
|
||||
|
@ -29,6 +28,7 @@ java_library(
|
|||
"@com_google_truth_extensions_truth_java8_extension",
|
||||
"@joda_time",
|
||||
"@junit",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ java_library(
|
|||
"//java/google/registry/proxy",
|
||||
"//java/google/registry/util",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"@com_beust_jcommander",
|
||||
"@com_google_dagger",
|
||||
"@com_google_guava",
|
||||
|
@ -39,6 +38,7 @@ java_library(
|
|||
"@joda_time",
|
||||
"@junit",
|
||||
"@org_bouncycastle_bcpkix_jdk15on",
|
||||
"@org_mockito_core",
|
||||
"@org_yaml_snakeyaml",
|
||||
],
|
||||
)
|
||||
|
|
|
@ -20,7 +20,6 @@ java_library(
|
|||
"//java/google/registry/ui/server/registrar",
|
||||
"//java/google/registry/util",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"//third_party/objectify:objectify-v4_1",
|
||||
"@com_google_appengine_api_1_0_sdk",
|
||||
"@com_google_code_findbugs_jsr305",
|
||||
|
@ -33,6 +32,7 @@ java_library(
|
|||
"@javax_servlet_api",
|
||||
"@joda_time",
|
||||
"@junit",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@ java_library(
|
|||
"//javatests/google/registry/testing/mapreduce",
|
||||
"//javatests/google/registry/testing/sftp",
|
||||
"//javatests/google/registry/xml",
|
||||
"//third_party/java/mockito",
|
||||
"//third_party/jaxb",
|
||||
"//third_party/jsch/v0_1_53",
|
||||
"//third_party/objectify:objectify-v4_1",
|
||||
|
@ -44,6 +43,7 @@ java_library(
|
|||
"@org_bouncycastle_bcpg_jdk15on",
|
||||
"@org_bouncycastle_bcpkix_jdk15on",
|
||||
"@org_joda_money",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@ java_library(
|
|||
"//java/google/registry/request",
|
||||
"//java/google/registry/util",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"@com_google_apis_google_api_services_bigquery",
|
||||
"@com_google_appengine_api_1_0_sdk",
|
||||
"@com_google_appengine_tools_appengine_gcs_client",
|
||||
|
@ -27,6 +26,7 @@ java_library(
|
|||
"@javax_servlet_api",
|
||||
"@joda_time",
|
||||
"@junit",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@ java_library(
|
|||
"//java/google/registry/storage/drive",
|
||||
"//java/google/registry/util",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"@com_google_apis_google_api_services_dataflow",
|
||||
"@com_google_appengine_api_1_0_sdk",
|
||||
"@com_google_appengine_tools_appengine_gcs_client",
|
||||
|
@ -31,6 +30,7 @@ java_library(
|
|||
"@org_apache_beam_runners_google_cloud_dataflow_java",
|
||||
"@org_apache_beam_sdks_java_core",
|
||||
"@org_apache_beam_sdks_java_io_google_cloud_platform",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@ java_library(
|
|||
"//java/google/registry/request",
|
||||
"//java/google/registry/util",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"@com_google_apis_google_api_services_bigquery",
|
||||
"@com_google_appengine_api_1_0_sdk",
|
||||
"@com_google_appengine_tools_appengine_gcs_client",
|
||||
|
@ -30,6 +29,7 @@ java_library(
|
|||
"@javax_servlet_api",
|
||||
"@joda_time",
|
||||
"@junit",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@ java_library(
|
|||
"//java/google/registry/reporting/spec11/soy:soy_java_wrappers",
|
||||
"//java/google/registry/util",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"@com_google_apis_google_api_services_dataflow",
|
||||
"@com_google_appengine_api_1_0_sdk",
|
||||
"@com_google_appengine_tools_appengine_gcs_client",
|
||||
|
@ -35,6 +34,7 @@ java_library(
|
|||
"@org_apache_beam_sdks_java_core",
|
||||
"@org_apache_beam_sdks_java_io_google_cloud_platform",
|
||||
"@org_json",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ java_library(
|
|||
"//java/google/registry/request",
|
||||
"//java/google/registry/request/auth",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"@com_google_appengine_api_1_0_sdk",
|
||||
"@com_google_guava",
|
||||
"@com_google_guava_testlib",
|
||||
|
@ -25,6 +24,7 @@ java_library(
|
|||
"@javax_servlet_api",
|
||||
"@joda_time",
|
||||
"@junit",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@ java_library(
|
|||
"//java/google/registry/request/auth",
|
||||
"//java/google/registry/security",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"//third_party/objectify:objectify-v4_1",
|
||||
"@com_google_appengine_api_1_0_sdk",
|
||||
"@com_google_appengine_tools_appengine_gcs_client",
|
||||
|
@ -31,6 +30,7 @@ java_library(
|
|||
"@com_google_truth_extensions_truth_java8_extension",
|
||||
"@javax_servlet_api",
|
||||
"@junit",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@ java_library(
|
|||
"//java/google/registry/request/lock",
|
||||
"//java/google/registry/util",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"//third_party/objectify:objectify-v4_1",
|
||||
"@com_google_appengine_api_1_0_sdk",
|
||||
"@com_google_appengine_tools_appengine_gcs_client",
|
||||
|
@ -26,6 +25,7 @@ java_library(
|
|||
"@com_google_truth_extensions_truth_java8_extension",
|
||||
"@joda_time",
|
||||
"@junit",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@ java_library(
|
|||
"//java/google/registry/security",
|
||||
"//java/google/registry/util",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"@com_google_appengine_api_1_0_sdk",
|
||||
"@com_google_appengine_testing",
|
||||
"@com_google_guava",
|
||||
|
@ -27,6 +26,7 @@ java_library(
|
|||
"@javax_servlet_api",
|
||||
"@joda_time",
|
||||
"@junit",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -13,13 +13,13 @@ java_library(
|
|||
deps = [
|
||||
"//java/google/registry/storage/drive",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"@com_google_apis_google_api_services_drive",
|
||||
"@com_google_guava",
|
||||
"@com_google_http_client",
|
||||
"@com_google_truth",
|
||||
"@com_google_truth_extensions_truth_java8_extension",
|
||||
"@junit",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -17,8 +17,9 @@ package google.registry.storage.drive;
|
|||
import static com.google.common.io.ByteStreams.toByteArray;
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.argThat;
|
||||
import static org.mockito.Matchers.anyString;
|
||||
import static org.mockito.Matchers.argThat;
|
||||
import static org.mockito.Matchers.eq;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.times;
|
||||
|
@ -59,14 +60,11 @@ public class DriveConnectionTest {
|
|||
List<String> allChildren;
|
||||
|
||||
private ArgumentMatcher<ByteArrayContent> hasByteArrayContent(final byte[] data) {
|
||||
return new ArgumentMatcher<ByteArrayContent>() {
|
||||
@Override
|
||||
public boolean matches(Object arg) {
|
||||
try {
|
||||
return Arrays.equals(data, toByteArray(((ByteArrayContent) arg).getInputStream()));
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
return arg -> {
|
||||
try {
|
||||
return Arrays.equals(data, toByteArray(arg.getInputStream()));
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -97,28 +95,29 @@ public class DriveConnectionTest {
|
|||
when(childrenList.execute()).thenReturn(childList1, childList2);
|
||||
when(childrenList.setQ(anyString())).thenReturn(childrenList);
|
||||
when(childrenList.getPageToken()).thenCallRealMethod();
|
||||
when(childrenList.setPageToken(anyString())).thenCallRealMethod();
|
||||
when(childrenList.setPageToken(any())).thenCallRealMethod();
|
||||
when(children.list("driveFolderId")).thenReturn(childrenList);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreateFileAtRoot() throws Exception {
|
||||
when(files.insert(
|
||||
eq(new File().setTitle("title").setMimeType("image/gif")),
|
||||
argThat(hasByteArrayContent(DATA))))
|
||||
.thenReturn(insert);
|
||||
eq(new File().setTitle("title").setMimeType("image/gif")),
|
||||
argThat(hasByteArrayContent(DATA))))
|
||||
.thenReturn(insert);
|
||||
assertThat(driveConnection.createFile("title", MediaType.GIF, null, DATA)).isEqualTo("id");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreateFileInFolder() throws Exception {
|
||||
when(files.insert(
|
||||
eq(new File()
|
||||
.setTitle("title")
|
||||
.setMimeType("image/gif")
|
||||
.setParents(ImmutableList.of(new ParentReference().setId("parent")))),
|
||||
argThat(hasByteArrayContent(DATA))))
|
||||
.thenReturn(insert);
|
||||
eq(
|
||||
new File()
|
||||
.setTitle("title")
|
||||
.setMimeType("image/gif")
|
||||
.setParents(ImmutableList.of(new ParentReference().setId("parent")))),
|
||||
argThat(hasByteArrayContent(DATA))))
|
||||
.thenReturn(insert);
|
||||
assertThat(driveConnection.createFile("title", MediaType.GIF, "parent", DATA)).isEqualTo("id");
|
||||
}
|
||||
|
||||
|
@ -164,12 +163,13 @@ public class DriveConnectionTest {
|
|||
@Test
|
||||
public void testCreateOrUpdateFile_succeedsForNewFile() throws Exception {
|
||||
when(files.insert(
|
||||
eq(new File()
|
||||
.setTitle("title")
|
||||
.setMimeType("video/webm")
|
||||
.setParents(ImmutableList.of(new ParentReference().setId("driveFolderId")))),
|
||||
argThat(hasByteArrayContent(DATA))))
|
||||
.thenReturn(insert);
|
||||
eq(
|
||||
new File()
|
||||
.setTitle("title")
|
||||
.setMimeType("video/webm")
|
||||
.setParents(ImmutableList.of(new ParentReference().setId("driveFolderId")))),
|
||||
argThat(hasByteArrayContent(DATA))))
|
||||
.thenReturn(insert);
|
||||
ChildList emptyChildList = new ChildList().setItems(ImmutableList.of()).setNextPageToken(null);
|
||||
when(childrenList.execute()).thenReturn(emptyChildList);
|
||||
assertThat(driveConnection.createOrUpdateFile(
|
||||
|
@ -183,10 +183,8 @@ public class DriveConnectionTest {
|
|||
@Test
|
||||
public void testCreateOrUpdateFile_succeedsForUpdatingFile() throws Exception {
|
||||
when(files.update(
|
||||
eq("id"),
|
||||
eq(new File().setTitle("title")),
|
||||
argThat(hasByteArrayContent(DATA))))
|
||||
.thenReturn(update);
|
||||
eq("id"), eq(new File().setTitle("title")), argThat(hasByteArrayContent(DATA))))
|
||||
.thenReturn(update);
|
||||
ChildList childList = new ChildList()
|
||||
.setItems(ImmutableList.of(new ChildReference().setId("id")))
|
||||
.setNextPageToken(null);
|
||||
|
@ -224,10 +222,8 @@ public class DriveConnectionTest {
|
|||
@Test
|
||||
public void testUpdateFile_succeeds() throws Exception {
|
||||
when(files.update(
|
||||
eq("id"),
|
||||
eq(new File().setTitle("title")),
|
||||
argThat(hasByteArrayContent(DATA))))
|
||||
.thenReturn(update);
|
||||
eq("id"), eq(new File().setTitle("title")), argThat(hasByteArrayContent(DATA))))
|
||||
.thenReturn(update);
|
||||
assertThat(driveConnection.updateFile("id", "title", MediaType.WEBM_VIDEO, DATA))
|
||||
.isEqualTo("id");
|
||||
}
|
||||
|
|
|
@ -35,7 +35,6 @@ java_library(
|
|||
"//java/google/registry/tmch",
|
||||
"//java/google/registry/util",
|
||||
"//java/google/registry/xml",
|
||||
"//third_party/java/mockito",
|
||||
"//third_party/objectify:objectify-v4_1",
|
||||
"@com_google_apis_google_api_services_appengine",
|
||||
"@com_google_appengine_api_1_0_sdk",
|
||||
|
@ -60,6 +59,7 @@ java_library(
|
|||
"@org_bouncycastle_bcpkix_jdk15on",
|
||||
"@org_joda_money",
|
||||
"@org_json",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@ java_library(
|
|||
"//java/google/registry/model",
|
||||
"//java/google/registry/util",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"@com_google_appengine_api_1_0_sdk",
|
||||
"@com_google_appengine_api_stubs",
|
||||
"@com_google_appengine_testing",
|
||||
|
@ -30,6 +29,7 @@ java_library(
|
|||
"@com_google_truth_extensions_truth_java8_extension",
|
||||
"@javax_servlet_api",
|
||||
"@junit",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ java_library(
|
|||
"//java/google/registry/tmch",
|
||||
"//java/google/registry/util",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"//third_party/objectify:objectify-v4_1",
|
||||
"@com_google_appengine_api_1_0_sdk",
|
||||
"@com_google_flogger",
|
||||
|
@ -32,6 +31,7 @@ java_library(
|
|||
"@javax_servlet_api",
|
||||
"@joda_time",
|
||||
"@junit",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -38,7 +38,6 @@ java_library(
|
|||
"//javatests/google/registry/tmch",
|
||||
"//javatests/google/registry/tools/server",
|
||||
"//javatests/google/registry/xml",
|
||||
"//third_party/java/mockito",
|
||||
"//third_party/jaxb",
|
||||
"//third_party/objectify:objectify-v4_1",
|
||||
"@com_beust_jcommander",
|
||||
|
@ -61,6 +60,7 @@ java_library(
|
|||
"@joda_time",
|
||||
"@junit",
|
||||
"@org_joda_money",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ java_library(
|
|||
"//javatests/google/registry/model",
|
||||
"//javatests/google/registry/testing",
|
||||
"//javatests/google/registry/testing/mapreduce",
|
||||
"//third_party/java/mockito",
|
||||
"//third_party/objectify:objectify-v4_1",
|
||||
"@com_google_appengine_api_1_0_sdk",
|
||||
"@com_google_appengine_tools_appengine_gcs_client",
|
||||
|
@ -34,6 +33,7 @@ java_library(
|
|||
"@joda_time",
|
||||
"@junit",
|
||||
"@org_joda_money",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -13,13 +13,13 @@ java_library(
|
|||
deps = [
|
||||
"//java/google/registry/ui/forms",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"@com_google_guava",
|
||||
"@com_google_guava_testlib",
|
||||
"@com_google_re2j",
|
||||
"@com_google_truth",
|
||||
"@com_google_truth_extensions_truth_java8_extension",
|
||||
"@junit",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -15,13 +15,13 @@ java_library(
|
|||
"//java/google/registry/ui/server",
|
||||
"//java/google/registry/util",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"@com_google_appengine_api_1_0_sdk",
|
||||
"@com_google_guava",
|
||||
"@com_google_truth",
|
||||
"@com_google_truth_extensions_truth_java8_extension",
|
||||
"@junit",
|
||||
"@org_hamcrest_library",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@ java_library(
|
|||
"//javatests/google/registry/model",
|
||||
"//javatests/google/registry/security",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"//third_party/objectify:objectify-v4_1",
|
||||
"@com_google_appengine_api_1_0_sdk",
|
||||
"@com_google_flogger",
|
||||
|
@ -40,6 +39,7 @@ java_library(
|
|||
"@joda_time",
|
||||
"@junit",
|
||||
"@org_joda_money",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@ java_library(
|
|||
deps = [
|
||||
"//java/google/registry/util",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"@com_google_appengine_api_1_0_sdk",
|
||||
"@com_google_code_findbugs_jsr305",
|
||||
"@com_google_flogger",
|
||||
|
@ -24,6 +23,7 @@ java_library(
|
|||
"@com_google_truth_extensions_truth_java8_extension",
|
||||
"@joda_time",
|
||||
"@junit",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ package google.registry.util;
|
|||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.testing.LogsSubject.assertAboutLogs;
|
||||
import static org.mockito.Matchers.argThat;
|
||||
import static org.mockito.ArgumentMatchers.argThat;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
|
@ -35,7 +35,6 @@ import org.junit.Rule;
|
|||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
import org.mockito.ArgumentMatcher;
|
||||
|
||||
/** Unit tests for {@link RequestStatusCheckerImpl}. */
|
||||
@RunWith(JUnit4.class)
|
||||
|
@ -53,16 +52,12 @@ public final class RequestStatusCheckerImplTest {
|
|||
*/
|
||||
private static LogQuery expectedLogQuery(final String requestLogId) {
|
||||
return argThat(
|
||||
new ArgumentMatcher<LogQuery>() {
|
||||
@Override
|
||||
public boolean matches(Object object) {
|
||||
assertThat(object).isInstanceOf(LogQuery.class);
|
||||
LogQuery logQuery = (LogQuery) object;
|
||||
assertThat(logQuery.getRequestIds()).containsExactly(requestLogId);
|
||||
assertThat(logQuery.getIncludeAppLogs()).isFalse();
|
||||
assertThat(logQuery.getIncludeIncomplete()).isTrue();
|
||||
return true;
|
||||
}
|
||||
object -> {
|
||||
assertThat(object).isInstanceOf(LogQuery.class);
|
||||
assertThat(object.getRequestIds()).containsExactly(requestLogId);
|
||||
assertThat(object.getIncludeAppLogs()).isFalse();
|
||||
assertThat(object.getIncludeIncomplete()).isTrue();
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@ java_library(
|
|||
"//java/google/registry/util",
|
||||
"//java/google/registry/whois",
|
||||
"//javatests/google/registry/testing",
|
||||
"//third_party/java/mockito",
|
||||
"//third_party/objectify:objectify-v4_1",
|
||||
"@com_google_appengine_api_1_0_sdk",
|
||||
"@com_google_appengine_testing",
|
||||
|
@ -33,6 +32,7 @@ java_library(
|
|||
"@javax_servlet_api",
|
||||
"@joda_time",
|
||||
"@junit",
|
||||
"@org_mockito_core",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue