diff --git a/it/pom.xml b/it/pom.xml
index f1313826ef..a08da7bb49 100644
--- a/it/pom.xml
+++ b/it/pom.xml
@@ -199,7 +199,6 @@
The class supports one Splunk server instance. - * - *
The class is thread-safe. - * - *
Note: The Splunk TestContainer will only run on M1 Mac's if the Docker version is >= 4.16.0 - * and the "Use Rosetta for x86/amd64 emulation on Apple Silicon" setting is enabled. - * - *
TODO - Remove when Beam 2.55 is released - https://github.com/apache/beam/pull/30200
- */
-public class CustomSplunkResourceManager extends TestContainerResourceManager This will be the HTTP endpoint concatenated with Note: Setting the Note: Setting the e.g. query: Note: This method should only be used if {@code useStaticContainer()} is also called.
- *
- * @param username the username for the Splunk instance.
- * @return this builder with the username manually set.
- */
- public Builder setUsername(String username) {
- this.username = username;
- return this;
- }
-
- /**
- * Manually set the Splunk password to the given password. This password will be used by the
- * resource manager to authenticate with Splunk.
- *
- * @param password the password for the Splunk instance.
- * @return this builder with the password manually set.
- */
- public Builder setPassword(String password) {
- this.password = password;
- return this;
- }
-
- /**
- * Manually set the Splunk HTTP Event Collector (HEC) token to the given token. This token will
- * be used by the resource manager to authenticate with Splunk.
- *
- * @param hecToken the HEC token for the Splunk instance.
- * @return this builder with the HEC token manually set.
- */
- public Builder setHecToken(String hecToken) {
- this.hecToken = hecToken;
- return this;
- }
-
- @Override
- public Builder setHost(String containerHost) {
- super.setHost(containerHost);
- this.port = 0;
- return this;
- }
-
- @Override
- public Builder setPort(int port) {
- throw new UnsupportedOperationException(
- "Please use setHecPort() and setSplunkdPort() instead.");
- }
-
- /**
- * Sets the port that the Splunk Http Event Collector (HEC) service is hosted on.
- *
- * @param port the port hosting the HEC service.
- * @return this builder object with the HEC port set.
- */
- public Builder setHecPort(int port) {
- this.hecPort = port;
- return this;
- }
-
- /**
- * Sets the port that the Splunkd service is hosted on.
- *
- * @param port the port hosting the Splunkd service.
- * @return this builder object with the Splunkd port set.
- */
- public Builder setSplunkdPort(int port) {
- this.splunkdPort = port;
- return this;
- }
-
- @Override
- public CustomSplunkResourceManager build() {
- return new CustomSplunkResourceManager(this);
- }
- }
-}
diff --git a/it/splunk/src/main/java/org/apache/beam/it/splunk/conditions/CustomSplunkEventsCheck.java b/it/splunk/src/main/java/org/apache/beam/it/splunk/conditions/CustomSplunkEventsCheck.java
deleted file mode 100644
index cdc42fcb2e..0000000000
--- a/it/splunk/src/main/java/org/apache/beam/it/splunk/conditions/CustomSplunkEventsCheck.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 org.apache.beam.it.splunk.conditions;
-
-import com.google.auto.value.AutoValue;
-import javax.annotation.Nullable;
-import org.apache.beam.it.conditions.ConditionCheck;
-import org.apache.beam.it.splunk.CustomSplunkResourceManager;
-
-/**
- * ConditionCheck to validate if Splunk has received a certain amount of events.
- *
- * TODO - Remove when Beam 2.55 is released - https://github.com/apache/beam/pull/30200
- */
-@AutoValue
-public abstract class CustomSplunkEventsCheck extends ConditionCheck {
-
- abstract CustomSplunkResourceManager resourceManager();
-
- @Nullable
- abstract String query();
-
- abstract Integer minEvents();
-
- @Nullable
- abstract Integer maxEvents();
-
- @Override
- public String getDescription() {
- if (maxEvents() != null) {
- return String.format(
- "Splunk check if logs have between %d and %d events", minEvents(), maxEvents());
- }
- return String.format("Splunk check if logs have %d events", minEvents());
- }
-
- @Override
- @SuppressWarnings("nullness")
- public CheckResult check() {
- long totalEvents;
- if (query() != null) {
- totalEvents = resourceManager().getEvents(query()).size();
- } else {
- totalEvents = resourceManager().getEvents().size();
- }
- if (totalEvents < minEvents()) {
- return new CheckResult(
- false, String.format("Expected %d but has only %d", minEvents(), totalEvents));
- }
- if (maxEvents() != null && totalEvents > maxEvents()) {
- return new CheckResult(
- false, String.format("Expected up to %d but found %d events", maxEvents(), totalEvents));
- }
-
- if (maxEvents() != null) {
- return new CheckResult(
- true,
- String.format(
- "Expected between %d and %d events and found %d",
- minEvents(), maxEvents(), totalEvents));
- }
-
- return new CheckResult(
- true, String.format("Expected at least %d events and found %d", minEvents(), totalEvents));
- }
-
- public static Builder builder(CustomSplunkResourceManager resourceManager) {
- return new AutoValue_CustomSplunkEventsCheck.Builder().setResourceManager(resourceManager);
- }
-
- /** Builder for {@link CustomSplunkEventsCheck}. */
- @AutoValue.Builder
- public abstract static class Builder {
-
- public abstract Builder setResourceManager(CustomSplunkResourceManager resourceManager);
-
- public abstract Builder setQuery(String query);
-
- public abstract Builder setMinEvents(Integer minEvents);
-
- public abstract Builder setMaxEvents(Integer maxEvents);
-
- abstract CustomSplunkEventsCheck autoBuild();
-
- public CustomSplunkEventsCheck build() {
- return autoBuild();
- }
- }
-}
diff --git a/it/splunk/src/main/java/org/apache/beam/it/splunk/conditions/package-info.java b/it/splunk/src/main/java/org/apache/beam/it/splunk/conditions/package-info.java
deleted file mode 100644
index 480e62ae43..0000000000
--- a/it/splunk/src/main/java/org/apache/beam/it/splunk/conditions/package-info.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 for managing Dataflow jobs from integration tests. */
-package org.apache.beam.it.splunk.conditions;
diff --git a/it/splunk/src/main/java/org/apache/beam/it/splunk/package-info.java b/it/splunk/src/main/java/org/apache/beam/it/splunk/package-info.java
deleted file mode 100644
index 4df9a97176..0000000000
--- a/it/splunk/src/main/java/org/apache/beam/it/splunk/package-info.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 for managing Dataflow jobs from integration tests. */
-package org.apache.beam.it.splunk;
diff --git a/v1/pom.xml b/v1/pom.xml
index 8e8ab4c241..f1465bbfd2 100644
--- a/v1/pom.xml
+++ b/v1/pom.xml
@@ -253,14 +253,6 @@
TODO - Change CustomSplunkResourceManager back when Beam 2.55 is released
- */
+/** Integration test for {@link PubSubToSplunk} classic template. */
@Category({TemplateIntegrationTest.class, SkipRunnerV2Test.class})
@TemplateIntegrationTest(PubSubToSplunk.class)
@RunWith(JUnit4.class)
@@ -69,7 +65,7 @@ public class PubSubToSplunkIT extends TemplateTestBase {
private static final int BAD_MESSAGES_COUNT = 50;
private PubsubResourceManager pubsubResourceManager;
- private CustomSplunkResourceManager splunkResourceManager;
+ private SplunkResourceManager splunkResourceManager;
private KMSResourceManager kmsResourceManager;
private static final String KEYRING_ID = "PubSubToSplunkIT";
@@ -84,7 +80,7 @@ public class PubSubToSplunkIT extends TemplateTestBase {
public void setUp() throws IOException {
pubsubResourceManager =
PubsubResourceManager.builder(testName, PROJECT, credentialsProvider).build();
- splunkResourceManager = CustomSplunkResourceManager.builder(testName).build();
+ splunkResourceManager = SplunkResourceManager.builder(testName).build();
kmsResourceManager = KMSResourceManager.builder(PROJECT, credentialsProvider).build();
gcsClient.createArtifact(
@@ -164,7 +160,7 @@ private void testPubSubToSplunkMain(
pipelineOperator()
.waitForConditionAndCancel(
createConfig(info),
- CustomSplunkEventsCheck.builder(splunkResourceManager)
+ SplunkEventsCheck.builder(splunkResourceManager)
.setQuery(query)
.setMinEvents(allDlq ? 0 : MESSAGES_COUNT)
.build(),
'/services/collector/event'.
- *
- * @return the HEC service endpoint.
- */
- public String getHecEndpoint() {
- return getHttpEndpoint() + "/services/collector/event";
- }
-
- /**
- * Returns the Splunk Http Event Collector (HEC) authentication token used to connect to this
- * Splunk instance's HEC service.
- *
- * @return the HEC authentication token.
- */
- public String getHecToken() {
- return hecToken;
- }
-
- /**
- * Helper method for converting the given SplunkEvent into JSON format.
- *
- * @param event The SplunkEvent to parse.
- * @return JSON String.
- */
- private static String splunkEventToJson(SplunkEvent event) {
- return new JSONObject(splunkEventToMap(event)).toString();
- }
-
- /**
- * Sends the given HTTP event to the Splunk Http Event Collector (HEC) service.
- *
- * index field in the Splunk event requires the index already
- * being configured in the Splunk instance. Unless using a static Splunk instance, omit this field
- * from the event.
- *
- * @param event The SpunkEvent to send to the HEC service.
- * @return True, if the request was successful.
- */
- public synchronized boolean sendHttpEvent(SplunkEvent event) {
- return sendHttpEvents(Collections.singletonList(event));
- }
-
- /**
- * Sends the given HTTP events to the Splunk Http Event Collector (HEC) service.
- *
- * index field in the Splunk event requires the index already
- * being configured in the Splunk instance. Unless using a static Splunk instance, omit this field
- * from the events.
- *
- * @param events The SpunkEvents to send to the HEC service.
- * @return True, if the request was successful.
- */
- public synchronized boolean sendHttpEvents(Collection'search source=mySource sourcetype=mySourceType host=myHost'
- *
- * @param query The query to filter events by.
- * @return All Splunk events on the server that match the given query.
- */
- public synchronized List