mirror of
https://github.com/google/nomulus.git
synced 2025-08-06 01:35:17 +02:00
Add apache beam to registry and open source
This is the initial commit of the new billing system, rewritten as an Apache Beam pipeline. This contains a basic end-to-end pipeline as proof of concept, and boilerplate for GenerateInvoicesAction, which will eventually be our automated invoice generation endpoint. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=174184171
This commit is contained in:
parent
d3254eaaeb
commit
eff2266e35
10 changed files with 703 additions and 2 deletions
31
javatests/google/registry/billing/BUILD
Normal file
31
javatests/google/registry/billing/BUILD
Normal file
|
@ -0,0 +1,31 @@
|
|||
package(
|
||||
default_testonly = 1,
|
||||
default_visibility = ["//java/google/registry:registry_project"],
|
||||
)
|
||||
|
||||
licenses(["notice"]) # Apache 2.0
|
||||
|
||||
load("//java/com/google/testing/builddefs:GenTestRules.bzl", "GenTestRules")
|
||||
|
||||
java_library(
|
||||
name = "billing",
|
||||
srcs = glob(["*.java"]),
|
||||
deps = [
|
||||
"//java/google/registry/billing",
|
||||
"@com_google_dagger",
|
||||
"@com_google_guava",
|
||||
"@com_google_truth",
|
||||
"@com_google_truth_extensions_truth_java8_extension",
|
||||
"@joda_time",
|
||||
"@junit",
|
||||
"@org_apache_beam_runners_google_cloud_dataflow_java",
|
||||
"@org_apache_beam_sdks_java_core",
|
||||
],
|
||||
)
|
||||
|
||||
GenTestRules(
|
||||
name = "GeneratedTestRules",
|
||||
default_test_size = "small",
|
||||
test_files = glob(["*Test.java"]),
|
||||
deps = [":billing"],
|
||||
)
|
38
javatests/google/registry/billing/MinWordCountTest.java
Normal file
38
javatests/google/registry/billing/MinWordCountTest.java
Normal file
|
@ -0,0 +1,38 @@
|
|||
// Copyright 2017 The Nomulus Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package google.registry.billing;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import google.registry.billing.MinWordCount.ExtractWordsFn;
|
||||
import java.util.List;
|
||||
import org.apache.beam.sdk.transforms.DoFnTester;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
/** Unit tests for {@link MinWordCount}*/
|
||||
@RunWith(JUnit4.class)
|
||||
public class MinWordCountTest {
|
||||
|
||||
@Test
|
||||
public void testDebuggingWordCount() throws Exception {
|
||||
ExtractWordsFn extractWordsFn = new ExtractWordsFn();
|
||||
DoFnTester<String, String> fntester = DoFnTester.of(extractWordsFn);
|
||||
String testInput = "hi there\nwhats up\nim good thanks";
|
||||
List<String> outputs = fntester.processBundle(testInput);
|
||||
assertThat(outputs).containsExactly("hi", "there", "whats", "up", "im", "good", "thanks");
|
||||
}
|
||||
}
|
|
@ -14,6 +14,7 @@ PATH CLASS METHOD
|
|||
/_dr/task/exportDomainLists ExportDomainListsAction POST n INTERNAL APP IGNORED
|
||||
/_dr/task/exportReservedTerms ExportReservedTermsAction POST n INTERNAL APP IGNORED
|
||||
/_dr/task/exportSnapshot ExportSnapshotAction POST y INTERNAL APP IGNORED
|
||||
/_dr/task/generateInvoices GenerateInvoicesAction POST n INTERNAL APP IGNORED
|
||||
/_dr/task/icannReportingStaging IcannReportingStagingAction POST n INTERNAL APP IGNORED
|
||||
/_dr/task/icannReportingUpload IcannReportingUploadAction POST n INTERNAL,API APP ADMIN
|
||||
/_dr/task/importRdeContacts RdeContactImportAction GET n INTERNAL APP IGNORED
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue