Skip to content

Conversation

@deep-splunk
Copy link
Contributor

No description provided.

@deep-splunk deep-splunk temporarily deployed to workflow-approval December 9, 2022 09:55 — with GitHub Actions Inactive
@github-actions
Copy link

github-actions bot commented Dec 9, 2022

Unit Test Results

153 tests   153 ✔️  38s ⏱️
  23 suites      0 💤
  23 files        0

Results for commit 4872510.

♻️ This comment has been updated with latest results.

@deep-splunk deep-splunk temporarily deployed to workflow-approval December 9, 2022 09:58 — with GitHub Actions Inactive
hvaghani221
hvaghani221 previously approved these changes Dec 12, 2022
@@ -0,0 +1,4 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove unwanted files

import java.util.function.Function;
import java.util.stream.Collectors;

import org.apache.avro.Protocol;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these imports required? If not, please remove them.

private Map<String, String> taskConfig;
private Map<String, ConfigValue> values;
private List<ConfigValue> validations;
private AbstractClientWrapper hecAb = new HecClientWrapper();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Should have some meaningful name

}


private void validateHealthCheckForSplunkIndexes(final Map<String, String> configs) throws ConfigException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it validating splunk health?

private void healthCheckForSplunkHEC(SplunkSinkConnectorConfig connectorConfig, String index) throws ConfigException {
Header[] headers;
headers = new Header[1];
headers[0] = new BasicHeader("Authorization", String.format("Splunk %s", connectorConfig.splunkToken));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you define headers as an inline array?

final HttpPost httpPost = new HttpPost(url);
httpPost.setHeaders(headers);
EventBatch batch = new JsonEventBatch();
Event event = new JsonEvent("a:a", null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does "a:a" represents?

((SplunkSinkConnector) connector).setHecInstance(clientInstance);
Assertions.assertDoesNotThrow(()->connector.validate(configs));
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also add tests for an invalid host, and invalid SSL configuration(i.e. HTTP request on HTTPS server and vice-versa)?

@hvaghani221 hvaghani221 self-requested a review December 12, 2022 05:57
@deep-splunk deep-splunk temporarily deployed to workflow-approval December 12, 2022 10:27 — with GitHub Actions Inactive
@deep-splunk deep-splunk temporarily deployed to workflow-approval December 13, 2022 05:33 — with GitHub Actions Inactive
hvaghani221
hvaghani221 previously approved these changes Dec 13, 2022
@deep-splunk deep-splunk temporarily deployed to workflow-approval December 13, 2022 06:24 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants