Search in sources :

Example 1 with ToStringBuilder

use of org.junit.platform.commons.util.ToStringBuilder in project cas by apereo.

the class MessageSanitizationUtilsTests method verifyOperation.

@Test
public void verifyOperation() {
    var results = MessageSanitizationUtils.sanitize("ticket TGT-1-abcdefg created");
    assertTrue(results.contains("TGT-1-*****"));
    results = MessageSanitizationUtils.sanitize("ticket PGT-1-abcdefg created");
    assertTrue(results.contains("PGT-1-*****"));
    results = MessageSanitizationUtils.sanitize("ticket PGTIOU-1-abcdefg created");
    assertTrue(results.contains("PGTIOU-1-*****"));
    results = MessageSanitizationUtils.sanitize("ticket OC-1-abcdefg created");
    assertTrue(results.contains("OC-1-*****"));
    results = MessageSanitizationUtils.sanitize("ticket AT-1-abcdefg created");
    assertTrue(results.contains("AT-1-*****"));
    results = MessageSanitizationUtils.sanitize("found a [password =se!ns4357$##@@**it!!_ive] here...");
    assertTrue(results.contains("[password =*****"));
    results = MessageSanitizationUtils.sanitize(new ToStringBuilder(this).append("password", "abcdefgs").append("field", "value").toString());
    assertTrue(results.contains("password = *****"));
    results = MessageSanitizationUtils.sanitize("found a [token=mgf63isnfb1s!!#ut0__|] here...");
    assertTrue(results.contains("[token=*****"));
    results = MessageSanitizationUtils.sanitize("found a ,clientSecret = p@$$wordSecret...");
    assertTrue(results.contains(",clientSecret = *****..."));
}
Also used : ToStringBuilder(org.junit.platform.commons.util.ToStringBuilder) Test(org.junit.jupiter.api.Test)

Example 2 with ToStringBuilder

use of org.junit.platform.commons.util.ToStringBuilder in project junit5 by junit-team.

the class ReportEntry method toString.

@Override
public String toString() {
    ToStringBuilder builder = new ToStringBuilder(this);
    builder.append("timestamp", this.timestamp);
    this.keyValuePairs.forEach(builder::append);
    return builder.toString();
}
Also used : ToStringBuilder(org.junit.platform.commons.util.ToStringBuilder)

Example 3 with ToStringBuilder

use of org.junit.platform.commons.util.ToStringBuilder in project junit5 by junit-team.

the class LauncherConfigurationParameters method toString.

@Override
public String toString() {
    ToStringBuilder builder = new ToStringBuilder(this);
    this.explicitConfigParams.forEach(builder::append);
    // @formatter:off
    this.configParamsFromFile.stringPropertyNames().stream().filter(key -> !this.explicitConfigParams.containsKey(key)).forEach(key -> builder.append(key, this.configParamsFromFile.getProperty(key)));
    return builder.toString();
}
Also used : Preconditions(org.junit.platform.commons.util.Preconditions) Properties(java.util.Properties) ToStringBuilder(org.junit.platform.commons.util.ToStringBuilder) ConfigurationParameters(org.junit.platform.engine.ConfigurationParameters) URL(java.net.URL) Logger(org.junit.platform.commons.logging.Logger) LoggerFactory(org.junit.platform.commons.logging.LoggerFactory) List(java.util.List) ClassLoaderUtils(org.junit.platform.commons.util.ClassLoaderUtils) Map(java.util.Map) Optional(java.util.Optional) Collections(java.util.Collections) InputStream(java.io.InputStream) ToStringBuilder(org.junit.platform.commons.util.ToStringBuilder)

Aggregations

ToStringBuilder (org.junit.platform.commons.util.ToStringBuilder)3 InputStream (java.io.InputStream)1 URL (java.net.URL)1 Collections (java.util.Collections)1 List (java.util.List)1 Map (java.util.Map)1 Optional (java.util.Optional)1 Properties (java.util.Properties)1 Test (org.junit.jupiter.api.Test)1 Logger (org.junit.platform.commons.logging.Logger)1 LoggerFactory (org.junit.platform.commons.logging.LoggerFactory)1 ClassLoaderUtils (org.junit.platform.commons.util.ClassLoaderUtils)1 Preconditions (org.junit.platform.commons.util.Preconditions)1 ConfigurationParameters (org.junit.platform.engine.ConfigurationParameters)1