Skip to content

Commit 37653a5

Browse files
committed
[Test] Removed a RSpec test that's already covered by JUnit
1 parent b114f2d commit 37653a5

File tree

2 files changed

+0
-25
lines changed

2 files changed

+0
-25
lines changed

logstash-core/spec/logstash/settings_spec.rb

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -299,25 +299,6 @@
299299
expect(LogStash::Setting::ValidatedPasswordSetting.new("test.validated.password", password, password_policies)).to_not be_nil
300300
end
301301
end
302-
303-
describe "mode WARN" do
304-
let(:password_policies) { super().merge("mode": "WARN") }
305-
306-
context "when the password does not conform to the policy" do
307-
let(:password) { LogStash::Util::Password.new("NoNumbers!") }
308-
let(:mock_logger) { double("logger") }
309-
310-
before :each do
311-
allow_any_instance_of(LogStash::Setting::ValidatedPassword).to receive(:logger).and_return(mock_logger)
312-
end
313-
314-
it "logs a warning on validation failure" do
315-
expect(mock_logger).to receive(:warn).with(a_string_including("Password must contain at least one digit between 0 and 9."))
316-
317-
LogStash::Setting::ValidatedPassword.new("test.validated.password", password, password_policies)
318-
end
319-
end
320-
end
321302
end
322303

323304
context "placeholders in nested logstash.yml" do

logstash-core/src/main/java/org/logstash/settings/ValidatedPasswordSetting.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,11 @@
2222
import co.elastic.logstash.api.Password;
2323
import org.apache.logging.log4j.LogManager;
2424
import org.apache.logging.log4j.Logger;
25-
import org.jruby.RubySymbol;
26-
import org.logstash.RubyUtil;
2725
import org.logstash.secret.password.PasswordPolicyParam;
2826
import org.logstash.secret.password.PasswordPolicyType;
2927
import org.logstash.secret.password.PasswordValidator;
3028

3129
import java.util.HashMap;
32-
import java.util.List;
3330
import java.util.Map;
3431

3532
public class ValidatedPasswordSetting extends PasswordSetting {
@@ -70,7 +67,6 @@ public Password coerce(Object password) {
7067
throw new IllegalArgumentException("Setting `" + getName() + "` could not coerce LogStash::Util::Password value to password");
7168
}
7269
LOGGER.info("Password policies: {}", passwordPolicies);
73-
System.out.printf("Password policies: %s%n", passwordPolicies);
7470
Map<PasswordPolicyType, PasswordPolicyParam> policies = buildPasswordPolicies();
7571
String validatedResult = new PasswordValidator(policies).validate(((Password) password).getValue());
7672

@@ -122,6 +118,4 @@ private static Object dig(Map<String, Object> map, String... path) {
122118
}
123119
return current;
124120
}
125-
126-
127121
}

0 commit comments

Comments
 (0)