コード例 #1
0
  @Test
  public void test_assertConfigurationIsValid_notSet() throws Exception {
    SecurityServiceConfig config = new SecurityServiceConfig(new ContainerConfiguration());

    try {
      AdsSecurityManager.assertConfigurationIsValid(config);
      fail();
    } catch (Exception e) {
      assertEquals(
          "La configuration ads est invalide.\n"
              + "Veuillez vérifier la valeur de la propriété SecurityService.config.",
          e.getLocalizedMessage());
    }
  }
コード例 #2
0
  @Test
  public void test_assertConfigurationIsValid_syntaxError() throws Exception {
    ContainerConfiguration configuration = new ContainerConfiguration();
    configuration.setParameter(SecurityServiceConfig.SECURITY_SERVICE_CONFIG, "ads:");
    SecurityServiceConfig config = new SecurityServiceConfig(configuration);

    try {
      AdsSecurityManager.assertConfigurationIsValid(config);
      fail();
    } catch (IllegalArgumentException e) {
      assertEquals(
          "La configuration ads est invalide.\n"
              + "Veuillez vérifier la valeur de la propriété SecurityService.config.",
          e.getLocalizedMessage());
    }
  }
コード例 #3
0
 @Test
 public void test_assertConfigurationIsValid() throws Exception {
   SecurityServiceConfig config =
       new SecurityServiceConfig(createDefaultMasterConfigWithAdsValues());
   AdsSecurityManager.assertConfigurationIsValid(config);
 }