Skip to content

Commit

Permalink
Fix test issues due to class renaming on main
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Ross <andrross@amazon.com>
  • Loading branch information
andrross committed Jun 26, 2024
1 parent 7acfe66 commit 0eff3eb
Showing 1 changed file with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import java.util.List;
import java.util.Set;

public class IngestCommonModulePluginTests extends OpenSearchTestCase {
public class IngestCommonPluginTests extends OpenSearchTestCase {

public void testAllowlist() throws IOException {
runAllowlistTest(List.of());
Expand All @@ -28,19 +28,17 @@ public void testAllowlist() throws IOException {
}

private void runAllowlistTest(List<String> allowlist) throws IOException {
final Settings settings = Settings.builder()
.putList(IngestCommonModulePlugin.PROCESSORS_ALLOWLIST_SETTING.getKey(), allowlist)
.build();
try (IngestCommonModulePlugin plugin = new IngestCommonModulePlugin()) {
final Settings settings = Settings.builder().putList(IngestCommonPlugin.PROCESSORS_ALLOWLIST_SETTING.getKey(), allowlist).build();
try (IngestCommonPlugin plugin = new IngestCommonPlugin()) {
assertEquals(Set.copyOf(allowlist), plugin.getProcessors(createParameters(settings)).keySet());
}
}

public void testAllowlistNotSpecified() throws IOException {
final Settings.Builder builder = Settings.builder();
builder.remove(IngestCommonModulePlugin.PROCESSORS_ALLOWLIST_SETTING.getKey());
builder.remove(IngestCommonPlugin.PROCESSORS_ALLOWLIST_SETTING.getKey());
final Settings settings = builder.build();
try (IngestCommonModulePlugin plugin = new IngestCommonModulePlugin()) {
try (IngestCommonPlugin plugin = new IngestCommonPlugin()) {
final Set<String> expected = Set.of(
"append",
"urldecode",
Expand Down Expand Up @@ -81,9 +79,9 @@ public void testAllowlistNotSpecified() throws IOException {

public void testAllowlistHasNonexistentProcessors() throws IOException {
final Settings settings = Settings.builder()
.putList(IngestCommonModulePlugin.PROCESSORS_ALLOWLIST_SETTING.getKey(), List.of("threeve"))
.putList(IngestCommonPlugin.PROCESSORS_ALLOWLIST_SETTING.getKey(), List.of("threeve"))
.build();
try (IngestCommonModulePlugin plugin = new IngestCommonModulePlugin()) {
try (IngestCommonPlugin plugin = new IngestCommonPlugin()) {
IllegalArgumentException e = expectThrows(
IllegalArgumentException.class,
() -> plugin.getProcessors(createParameters(settings))
Expand Down

0 comments on commit 0eff3eb

Please sign in to comment.