Java Code Examples for org.testcontainers.shaded.com.google.common.collect.ImmutableList#of()

The following examples show how to use org.testcontainers.shaded.com.google.common.collect.ImmutableList#of() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestRuleDefinitionValidator.java    From datacollector with Apache License 2.0 5 votes vote down vote up
@Test
public void testInValidConfiguration() {
  List<Config> rulesConfiguration = ImmutableList.of(
      new Config("emailIDs", ImmutableList.of("${USER_EMAIL_ID}"))
  );
  RuleDefinitions ruleDefinitions = new RuleDefinitions(
      FilePipelineStoreTask.RULE_DEFINITIONS_SCHEMA_VERSION,
      RuleDefinitionsConfigBean.VERSION,
      Collections.<MetricsRuleDefinition>emptyList(),
      Collections.<DataRuleDefinition>emptyList(),
      Collections.<DriftRuleDefinition>emptyList(),
      null,
      UUID.randomUUID(),
      rulesConfiguration
  );

  RuleDefinitionValidator ruleDefinitionValidator = new RuleDefinitionValidator(
      "pipelineId",
      ruleDefinitions,
      Collections.emptyMap()
  );

  Assert.assertFalse(ruleDefinitionValidator.validateRuleDefinition());
  Assert.assertNotNull(ruleDefinitions.getConfigIssues());
  Assert.assertEquals(1, ruleDefinitions.getConfigIssues().size());
  Assert.assertEquals("emailIDs", ruleDefinitions.getConfigIssues().get(0).getConfigName());
  Assert.assertTrue(
      ruleDefinitions.getConfigIssues().get(0).getMessage().contains("'USER_EMAIL_ID' cannot be resolved")
  );

  ruleDefinitionValidator = new RuleDefinitionValidator(
      "pipelineId",
      ruleDefinitions,
      ImmutableMap.of("USER_EMAIL_ID", "[email protected]")
  );

  Assert.assertTrue(ruleDefinitionValidator.validateRuleDefinition());
  Assert.assertNotNull(ruleDefinitions.getConfigIssues());
  Assert.assertEquals(0, ruleDefinitions.getConfigIssues().size());
}
 
Example 2
Source File: TestRuleDefinitionsUpgrader.java    From datacollector with Apache License 2.0 5 votes vote down vote up
private RuleDefinitions getSchemaVersion2RuleDefinitions() {
  return new RuleDefinitions(
      2,
      RuleDefinitionsConfigBean.VERSION,
      Collections.emptyList(),
      Collections.emptyList(),
      Collections.emptyList(),
      ImmutableList.of("[email protected]", "[email protected]"),
      UUID.randomUUID(),
      new ArrayList<>()
  );
}
 
Example 3
Source File: TestClassloaderInContextCredentialStore.java    From datacollector with Apache License 2.0 4 votes vote down vote up
@Override
public List<String> getNames() throws StageException {
  Assert.assertEquals(expectedClassLoader, Thread.currentThread().getContextClassLoader());
  return ImmutableList.of("credential");
}