Skip to content

Commit

Permalink
Add unit tests for bruteforce properties
Browse files Browse the repository at this point in the history
  • Loading branch information
TuningYourCode committed Jun 14, 2024
1 parent 31fdd37 commit 9ffefcd
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions spec/unit/puppet/type/keycloak_realm_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,14 @@
admin_events_enabled: :false,
admin_events_details_enabled: :false,
offline_session_max_lifespan_enabled: :false,
internationalization_enabled: :false
internationalization_enabled: :false,
permanent_lockout: :false,
max_failure_wait_seconds: 900,
minimum_quick_login_wait_seconds: 60,
wait_increment_seconds: 60,
quick_login_check_milli_seconds: 1000,
max_delta_time_seconds: 43200,

Check failure on line 66 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 7 (Ruby 2.7.7 fixtures=.fixtures.yml)

Style/NumericLiterals: Use underscores(_) as thousands separator and separate every 3 digits with them. (https://rubystyle.guide#underscores-in-numerics)

Check failure on line 66 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 8 (Ruby 3.2.2 fixtures=.fixtures.yml)

Style/NumericLiterals: Use underscores(_) as thousands separator and separate every 3 digits with them. (https://rubystyle.guide#underscores-in-numerics)

Check failure on line 66 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 7 (Ruby 2.7.7 fixtures=.fixtures-latest.yml)

Style/NumericLiterals: Use underscores(_) as thousands separator and separate every 3 digits with them. (https://rubystyle.guide#underscores-in-numerics)

Check failure on line 66 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 8 (Ruby 3.2.2 fixtures=.fixtures-latest.yml)

Style/NumericLiterals: Use underscores(_) as thousands separator and separate every 3 digits with them. (https://rubystyle.guide#underscores-in-numerics)
failure_factor: 30,

Check failure on line 67 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 7 (Ruby 2.7.7 fixtures=.fixtures.yml)

Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.

Check failure on line 67 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 8 (Ruby 3.2.2 fixtures=.fixtures.yml)

Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.

Check failure on line 67 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 7 (Ruby 2.7.7 fixtures=.fixtures-latest.yml)

Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.

Check failure on line 67 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 8 (Ruby 3.2.2 fixtures=.fixtures-latest.yml)

Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
}

describe 'basic properties' do
Expand Down Expand Up @@ -116,7 +123,13 @@
:action_token_generated_by_user_lifespan,
:offline_session_idle_timeout,
:offline_session_max_lifespan,
:smtp_server_port
:smtp_server_port,
:max_failure_wait_seconds,
:minimum_quick_login_wait_seconds,
:wait_increment_seconds,
:quick_login_check_milli_seconds,
:max_delta_time_seconds,
:failure_factor,

Check failure on line 132 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 7 (Ruby 2.7.7 fixtures=.fixtures.yml)

Style/TrailingCommaInArrayLiteral: Avoid comma after the last item of an array. (https://rubystyle.guide#no-trailing-array-commas)

Check failure on line 132 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 8 (Ruby 3.2.2 fixtures=.fixtures.yml)

Style/TrailingCommaInArrayLiteral: Avoid comma after the last item of an array. (https://rubystyle.guide#no-trailing-array-commas)

Check failure on line 132 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 7 (Ruby 2.7.7 fixtures=.fixtures-latest.yml)

Style/TrailingCommaInArrayLiteral: Avoid comma after the last item of an array. (https://rubystyle.guide#no-trailing-array-commas)

Check failure on line 132 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 8 (Ruby 3.2.2 fixtures=.fixtures-latest.yml)

Style/TrailingCommaInArrayLiteral: Avoid comma after the last item of an array. (https://rubystyle.guide#no-trailing-array-commas)
].each do |p|
it "accepts a #{p}" do
config[p] = 100
Expand Down Expand Up @@ -151,7 +164,8 @@
:smtp_server_starttls,
:smtp_server_ssl,
:brute_force_protected,
:offline_session_max_lifespan_enabled
:offline_session_max_lifespan_enabled,
:permanent_lockout,

Check failure on line 168 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 7 (Ruby 2.7.7 fixtures=.fixtures.yml)

Style/TrailingCommaInArrayLiteral: Avoid comma after the last item of an array. (https://rubystyle.guide#no-trailing-array-commas)

Check failure on line 168 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 8 (Ruby 3.2.2 fixtures=.fixtures.yml)

Style/TrailingCommaInArrayLiteral: Avoid comma after the last item of an array. (https://rubystyle.guide#no-trailing-array-commas)

Check failure on line 168 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 7 (Ruby 2.7.7 fixtures=.fixtures-latest.yml)

Style/TrailingCommaInArrayLiteral: Avoid comma after the last item of an array. (https://rubystyle.guide#no-trailing-array-commas)

Check failure on line 168 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 8 (Ruby 3.2.2 fixtures=.fixtures-latest.yml)

Style/TrailingCommaInArrayLiteral: Avoid comma after the last item of an array. (https://rubystyle.guide#no-trailing-array-commas)
].each do |p|
it "accepts true for #{p}" do
config[p] = true
Expand Down

0 comments on commit 9ffefcd

Please sign in to comment.