Skip to content

Commit

Permalink
Fixing merge conflicts
Browse files Browse the repository at this point in the history
Signed-off-by: Sarat Vemulapalli <[email protected]>
  • Loading branch information
saratvemulapalli committed Aug 23, 2024
1 parent ef0b862 commit ee12522
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.util.List;
import java.util.Set;

public class IngestUserAgentModulePluginTests extends OpenSearchTestCase {
public class IngestUserAgentPluginTests extends OpenSearchTestCase {
private Settings.Builder settingsBuilder;

@Before
Expand Down Expand Up @@ -62,10 +62,10 @@ public void testAllowList() throws IOException {
public void testInvalidAllowList() throws IOException {
List<String> invalidAllowList = List.of("set");
final Settings settings = settingsBuilder.putList(
IngestUserAgentModulePlugin.PROCESSORS_ALLOWLIST_SETTING.getKey(),
IngestUserAgentPlugin.PROCESSORS_ALLOWLIST_SETTING.getKey(),
invalidAllowList
).build();
try (IngestUserAgentModulePlugin plugin = new IngestUserAgentModulePlugin()) {
try (IngestUserAgentPlugin plugin = new IngestUserAgentPlugin()) {
IllegalArgumentException e = expectThrows(
IllegalArgumentException.class,
() -> plugin.getProcessors(createParameters(settings))
Expand All @@ -74,25 +74,25 @@ public void testInvalidAllowList() throws IOException {
"Processor(s) "
+ invalidAllowList
+ " were defined in ["
+ IngestUserAgentModulePlugin.PROCESSORS_ALLOWLIST_SETTING.getKey()
+ IngestUserAgentPlugin.PROCESSORS_ALLOWLIST_SETTING.getKey()
+ "] but do not exist",
e.getMessage()
);
}
}

public void testAllowListNotSpecified() throws IOException {
settingsBuilder.remove(IngestUserAgentModulePlugin.PROCESSORS_ALLOWLIST_SETTING.getKey());
try (IngestUserAgentModulePlugin plugin = new IngestUserAgentModulePlugin()) {
settingsBuilder.remove(IngestUserAgentPlugin.PROCESSORS_ALLOWLIST_SETTING.getKey());
try (IngestUserAgentPlugin plugin = new IngestUserAgentPlugin()) {
final Set<String> expected = Set.of("user_agent");
assertEquals(expected, plugin.getProcessors(createParameters(settingsBuilder.build())).keySet());
}
}

private void runAllowListTest(List<String> allowList) throws IOException {
final Settings settings = settingsBuilder.putList(IngestUserAgentModulePlugin.PROCESSORS_ALLOWLIST_SETTING.getKey(), allowList)
final Settings settings = settingsBuilder.putList(IngestUserAgentPlugin.PROCESSORS_ALLOWLIST_SETTING.getKey(), allowList)
.build();
try (IngestUserAgentModulePlugin plugin = new IngestUserAgentModulePlugin()) {
try (IngestUserAgentPlugin plugin = new IngestUserAgentPlugin()) {
assertEquals(Set.copyOf(allowList), plugin.getProcessors(createParameters(settings)).keySet());
}
}
Expand Down

0 comments on commit ee12522

Please sign in to comment.