Skip to content

Commit

Permalink
Change isSecret to secret based on PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
craigtaverner committed Apr 5, 2018
1 parent fd7ca16 commit 86bc8f7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
Expand Up @@ -34,23 +34,23 @@ public class ConfigValue
private final Optional<?> value;
private final String valueDescription;
private final boolean internal;
private final boolean isSecret;
private final boolean secret;
private final boolean dynamic;
private final boolean deprecated;
private final Optional<String> replacement;

public ConfigValue( @Nonnull String name, @Nonnull Optional<String> description,
@Nonnull Optional<String> documentedDefaultValue, @Nonnull Optional<?> value,
@Nonnull String valueDescription, boolean internal, boolean dynamic, boolean deprecated,
@Nonnull Optional<String> replacement, boolean isSecret )
@Nonnull Optional<String> replacement, boolean secret )
{
this.name = name;
this.description = description;
this.documentedDefaultValue = documentedDefaultValue;
this.value = value;
this.valueDescription = valueDescription;
this.internal = internal;
this.isSecret = isSecret;
this.secret = secret;
this.dynamic = dynamic;
this.deprecated = deprecated;
this.replacement = replacement;
Expand All @@ -77,7 +77,7 @@ public Optional<?> value()
@Nonnull
public Optional<String> valueAsString()
{
return this.isSecret() ? Optional.of( Secret.OBSFUCATED ) : value.map( ConfigValue::valueToString );
return this.secret() ? Optional.of( Secret.OBSFUCATED ) : value.map( ConfigValue::valueToString );
}

@Override
Expand All @@ -102,9 +102,9 @@ public boolean internal()
return internal;
}

public boolean isSecret()
public boolean secret()
{
return isSecret;
return secret;
}

public boolean dynamic()
Expand Down
Expand Up @@ -42,7 +42,7 @@ public void handlesEmptyValue() throws Exception
assertFalse( value.deprecated() );
assertEquals( Optional.empty(), value.replacement() );
assertFalse( value.internal() );
assertFalse( value.isSecret() );
assertFalse( value.secret() );
}

@Test
Expand All @@ -52,7 +52,7 @@ public void handlesInternal() throws Exception
"description", true, false, false, Optional.empty(), false );

assertTrue( value.internal() );
assertFalse( value.isSecret() );
assertFalse( value.secret() );
}

@Test
Expand All @@ -66,7 +66,7 @@ public void handlesNonEmptyValue() throws Exception
assertFalse( value.deprecated() );
assertEquals( Optional.empty(), value.replacement() );
assertFalse( value.internal() );
assertFalse( value.isSecret() );
assertFalse( value.secret() );
}

@Test
Expand All @@ -80,7 +80,7 @@ public void handlesDeprecationAndReplacement() throws Exception
assertTrue( value.deprecated() );
assertEquals( "new_name", value.replacement().get() );
assertFalse( value.internal() );
assertFalse( value.isSecret() );
assertFalse( value.secret() );
}

@Test
Expand All @@ -94,7 +94,7 @@ public void handlesValueDescription() throws Exception
assertTrue( value.deprecated() );
assertEquals( "new_name", value.replacement().get() );
assertFalse( value.internal() );
assertFalse( value.isSecret() );
assertFalse( value.secret() );
assertEquals( "a simple integer", value.valueDescription() );
}

Expand All @@ -109,7 +109,7 @@ public void handlesSecretValue() throws Exception
assertFalse( value.deprecated() );
assertEquals( Optional.empty(), value.replacement() );
assertFalse( value.internal() );
assertTrue( value.isSecret() );
assertTrue( value.secret() );
}

@Test
Expand Down
Expand Up @@ -276,8 +276,8 @@ public void shouldSetSecretParameter()
.build();

// Then
assertTrue( config.getConfigValues().get( MySettingsWithDefaults.password.name() ).isSecret() );
assertFalse( config.getConfigValues().get( MySettingsWithDefaults.hello.name() ).isSecret() );
assertTrue( config.getConfigValues().get( MySettingsWithDefaults.password.name() ).secret() );
assertFalse( config.getConfigValues().get( MySettingsWithDefaults.hello.name() ).secret() );
String configText = config.toString();
assertTrue( configText.contains( Secret.OBSFUCATED ) );
assertFalse( configText.contains( "this should not be visible" ) );
Expand Down

0 comments on commit 86bc8f7

Please sign in to comment.