Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Re-Implements the NextcloudConnectionValidator using the multple status retun (#18471)

Marcello Rochac76232b25fe4
diff --git a/app/models/types/patterns/token_property_mapper.rb b/app/models/types/patterns/token_property_mapper.rb
index 1488f1aba2e..a739a0e3fec 100644
--- a/app/models/types/patterns/token_property_mapper.rb
+++ b/app/models/types/patterns/token_property_mapper.rb
@@ -47,7 +47,7 @@ module Types
creation_date: { fn: ->(wp) { wp.created_at }, label: -> { WorkPackage.human_attribute_name(:created_at) } },
estimated_time: { fn: ->(wp) { wp.estimated_hours }, label: -> { WorkPackage.human_attribute_name(:estimated_hours) } },
finish_date: { fn: ->(wp) { wp.due_date }, label: -> { WorkPackage.human_attribute_name(:due_date) } },
- parent_id: { fn: ->(wp) { wp.parent&.id }, label: -> { WorkPackage.human_attribute_name(:parent_id) } },
+ parent_id: { fn: ->(wp) { wp.parent&.id }, label: -> { WorkPackage.human_attribute_name(:id) } },
parent_assignee: { fn: ->(wp) { wp.parent&.assigned_to&.name }, label: -> {
WorkPackage.human_attribute_name(:assigned_to)
} },
diff --git a/modules/storages/app/common/storages/peripherals/connection_validators/base_validator_group.rb b/modules/storages/app/common/storages/peripherals/connection_validators/base_validator_group.rb
new file mode 100644
index 00000000000..36e5501170a
--- /dev/null
+++ b/modules/storages/app/common/storages/peripherals/connection_validators/base_validator_group.rb
@@ -0,0 +1,82 @@
+# frozen_string_literal: true
+
+#-- copyright
+# OpenProject is an open source project management software.
+# Copyright (C) the OpenProject GmbH
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License version 3.
+#
+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+# Copyright (C) 2006-2013 Jean-Philippe Lang
+# Copyright (C) 2010-2013 the ChiliProject Team
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# See COPYRIGHT and LICENSE files for more details.
+#++
+
+module Storages
+ module Peripherals
+ module ConnectionValidators
+ class BaseValidatorGroup
+ include TaggedLogging
+
+ def initialize(storage)
+ @storage = storage
+ @results = ValidationGroupResult.new
+ end
+
+ def call
+ catch :interrupted do
+ validate
+ end
+
+ @results
+ end
+
+ private
+
+ def validate = raise Errors::SubclassResponsibility
+
+ def register_checks(*keys)
+ keys.each { @results.register_check(it) }
+ end
+
+ def update_result(...)
+ @results.update_result(...)
+ end
+
+ def pass_check(key)
+ update_result(key, CheckResult.success(key))
+ end
+
+ def fail_check(key, message)
+ update_result(key, CheckResult.failure(key, message))
+ throw :interrupted
+ end
+
+ def warn_check(key, message, halt_validation: false)
+ update_result(key, CheckResult.warning(key, message))
+ throw :interrupted if halt_validation
+ end
+
+ def message(key, context = {})
+ I18n.t("storages.health.connection_validation.#{key}", **context)
+ end
+ end
+ end
+ end
+end
diff --git a/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/ampf_connection_validator.rb b/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/ampf_configuration_validator.rb
similarity index 96%
rename from modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/ampf_connection_validator.rb
rename to modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/ampf_configuration_validator.rb
index 3bdebff3dac..e97338cb089 100644
--- a/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/ampf_connection_validator.rb
+++ b/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/ampf_configuration_validator.rb
@@ -32,19 +32,19 @@ module Storages
module Peripherals
module ConnectionValidators
module Nextcloud
- class AmpfConnectionValidator < BaseValidator
+ class AmpfConfigurationValidator < BaseValidatorGroup
using ServiceResultRefinements
private
def validate
register_checks(
- :userless_access, :group_folder_presence, :files_request, :group_folder_contents
+ :files_request, :userless_access, :group_folder_presence, :group_folder_contents
)
+ files_request_failed_with_unknown_error
userless_access_denied
group_folder_not_found
- files_request_failed_with_unknown_error
with_unexpected_content
end
diff --git a/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/authentication_validator.rb b/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/authentication_validator.rb
index 6289b27dac3..511c53dceb0 100644
--- a/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/authentication_validator.rb
+++ b/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/authentication_validator.rb
@@ -32,7 +32,7 @@ module Storages
module Peripherals
module ConnectionValidators
module Nextcloud
- class AuthenticationValidator < BaseValidator
+ class AuthenticationValidator < BaseValidatorGroup
def initialize(storage)
super
@user = User.current
diff --git a/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/base_configuration_validator.rb b/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/storage_configuration_validator.rb
similarity index 85%
rename from modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/base_configuration_validator.rb
rename to modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/storage_configuration_validator.rb
index 1d64b0b2982..cebf4393508 100644
--- a/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/base_configuration_validator.rb
+++ b/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/storage_configuration_validator.rb
@@ -32,21 +32,31 @@ module Storages
module Peripherals
module ConnectionValidators
module Nextcloud
- class BaseConfigurationValidator < BaseValidator
+ class StorageConfigurationValidator < BaseValidatorGroup
private
def validate
- register_checks(:capabilities_request, :host_url_accessible, :dependencies_check, :dependencies_versions)
+ register_checks(:storage_configured, :capabilities_request,
+ :host_url_accessible, :dependencies_check, :dependencies_versions)
+ storage_configuration_status
capabilities_request_status
host_url_not_found
missing_dependencies
version_mismatch
end
+ def storage_configuration_status
+ if @storage.configured?
+ pass_check(:storage_configured)
+ else
+ fail_check(:storage_configured, message(:not_configured))
+ end
+ end
+
def capabilities_request_status
if capabilities.failure? && capabilities.result != :not_found
- fail_check(:capabilities_request, message(:error))
+ fail_check(:capabilities_request, message(:unknown_error))
else
pass_check(:capabilities_request)
end
diff --git a/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/base_validator.rb b/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud_validator.rb
similarity index 51%
rename from modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/base_validator.rb
rename to modules/storages/app/common/storages/peripherals/connection_validators/nextcloud_validator.rb
index 34afb6f8842..7c75def5754 100644
--- a/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/base_validator.rb
+++ b/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud_validator.rb
@@ -31,56 +31,41 @@
module Storages
module Peripherals
module ConnectionValidators
- module Nextcloud
- class BaseValidator
- include TaggedLogging
-
- def initialize(storage)
- @storage = storage
+ class NextcloudValidator
+ # Class Level interface will be moved to a superclass/mixin once we do the OneDrive port
+ class << self
+ def validation_groups
+ @validation_groups ||= {}
end
- def call
- catch :interrupted do
- validate
- end
-
- @results
+ def register_group(group_name, klass, when: ->(*) { true })
+ validation_groups[group_name] = { klass:, when: }
end
+ end
- private
-
- def validate = raise Errors::SubclassResponsibility
+ register_group :base_configuration, Nextcloud::StorageConfigurationValidator
+ register_group :authentication, Nextcloud::AuthenticationValidator,
+ when: ->(_, result) { result.group(:base_configuration).non_failure? }
+ register_group :ampf_configuration, Nextcloud::AmpfConfigurationValidator,
+ when: ->(storage, result) {
+ result.group(:base_configuration).non_failure? && storage.automatic_management_enabled?
+ }
- def register_checks(*keys)
- @results = keys.to_h { [it, CheckResult.skipped(it)] }
- end
+ def initialize(storage:)
+ @storage = storage
+ end
- def update_result(key, value)
- if @results&.has_key?(key)
- @results[key] = value
- else
- raise ArgumentError, "Check #{key} not registered."
+ def validate
+ validation_groups.each_with_object(ValidatorResult.new) do |(key, group_metadata), result|
+ if group_metadata[:when].call(@storage, result)
+ result.add_group_result(key, group_metadata[:klass].new(@storage).call)
end
end
+ end
- def pass_check(key)
- update_result(key, CheckResult.success(key))
- end
-
- def fail_check(key, message)
- update_result(key, CheckResult.failure(key, message))
- throw :interrupted
- end
+ private
- def warn_check(key, message, halt_validation: false)
- update_result(key, CheckResult.warning(key, message))
- throw :interrupted if halt_validation
- end
-
- def message(key, context = {})
- I18n.t("storages.health.connection_validation.#{key}", **context)
- end
- end
+ def validation_groups = self.class.validation_groups
end
end
end
diff --git a/modules/storages/app/common/storages/peripherals/connection_validators/validation_group_result.rb b/modules/storages/app/common/storages/peripherals/connection_validators/validation_group_result.rb
new file mode 100644
index 00000000000..7b87cd1b589
--- /dev/null
+++ b/modules/storages/app/common/storages/peripherals/connection_validators/validation_group_result.rb
@@ -0,0 +1,68 @@
+# frozen_string_literal: true
+
+#-- copyright
+# OpenProject is an open source project management software.
+# Copyright (C) the OpenProject GmbH
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License version 3.
+#
+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+# Copyright (C) 2006-2013 Jean-Philippe Lang
+# Copyright (C) 2010-2013 the ChiliProject Team
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# See COPYRIGHT and LICENSE files for more details.
+#++
+
+module Storages
+ module Peripherals
+ module ConnectionValidators
+ class ValidationGroupResult
+ delegate :[], to: :@results
+
+ def initialize
+ @results = {}
+ end
+
+ def success? = @results.values.all?(&:success?)
+ def non_failure? = @results.values.none?(&:failure?)
+ def failure? = @results.values.any?(&:failure?)
+ def warning? = @results.values.any?(&:warning?)
+
+ def tally
+ @results.values.map(&:state).tally
+ end
+
+ def register_checks(keys)
+ Array(keys).each { register_check(it) }
+ end
+
+ def register_check(key)
+ warn("Overriding already defined check") if @results.key?(key)
+
+ @results[key] = CheckResult.skipped(key)
+ end
+
+ def update_result(key, value)
+ raise(ArgumentError, "Check #{key} not registered.") unless @results.key?(key)
+
+ @results[key] = value
+ end
+ end
+ end
+ end
+end
diff --git a/modules/storages/app/common/storages/peripherals/connection_validators/validator_result.rb b/modules/storages/app/common/storages/peripherals/connection_validators/validator_result.rb
new file mode 100644
index 00000000000..5dd26295ad6
--- /dev/null
+++ b/modules/storages/app/common/storages/peripherals/connection_validators/validator_result.rb
@@ -0,0 +1,58 @@
+# frozen_string_literal: true
+
+#-- copyright
+# OpenProject is an open source project management software.
+# Copyright (C) the OpenProject GmbH
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License version 3.
+#
+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+# Copyright (C) 2006-2013 Jean-Philippe Lang
+# Copyright (C) 2010-2013 the ChiliProject Team
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# See COPYRIGHT and LICENSE files for more details.
+#++
+
+module Storages
+ module Peripherals
+ module ConnectionValidators
+ class ValidatorResult
+ private attr_reader :group_results
+
+ delegate :each_pair, :empty?, to: :group_results
+
+ def initialize
+ @group_results = {}
+ end
+
+ def healthy? = group_results.values.all?(&:success?)
+ def unhealthy? = group_results.values.any?(&:failure?)
+ def warning? = group_results.values.any?(&:warning?)
+
+ def group(key) = group_results.fetch(key)
+ alias_method :fetch, :group
+
+ def add_group_result(key, result)
+ Kernel.warn "Overwriting #{key} results" if group_results.key?(key)
+
+ group_results[key] = result
+ end
+ end
+ end
+ end
+end
diff --git a/modules/storages/spec/common/storages/peripherals/connection_validators/nextcloud/ampf_connection_validator_spec.rb b/modules/storages/spec/common/storages/peripherals/connection_validators/nextcloud/ampf_configuration_validator_spec.rb
similarity index 94%
rename from modules/storages/spec/common/storages/peripherals/connection_validators/nextcloud/ampf_connection_validator_spec.rb
rename to modules/storages/spec/common/storages/peripherals/connection_validators/nextcloud/ampf_configuration_validator_spec.rb
index c5ffae86fa5..7ddf4de2900 100644
--- a/modules/storages/spec/common/storages/peripherals/connection_validators/nextcloud/ampf_connection_validator_spec.rb
+++ b/modules/storages/spec/common/storages/peripherals/connection_validators/nextcloud/ampf_configuration_validator_spec.rb
@@ -35,7 +35,7 @@ module Storages
module Peripherals
module ConnectionValidators
module Nextcloud
- RSpec.describe AmpfConnectionValidator, :webmock do
+ RSpec.describe AmpfConfigurationValidator, :webmock do
let(:storage) { create(:nextcloud_storage_configured, :as_automatically_managed) }
let(:project_folder_id) { "1337" }
let!(:project_storage) do
@@ -57,9 +57,7 @@ module Storages
end
it "pass all checks" do
- results = validator.call
-
- expect(results.values).to all(be_success)
+ expect(validator.call).to be_success
end
context "if userless authentication fails" do
@@ -68,8 +66,8 @@ module Storages
it "fails and skips the next checks" do
results = validator.call
- states = results.values.map { it.state }.tally
- expect(states).to eq({ failure: 1, skipped: 3 })
+ states = results.tally
+ expect(states).to eq({ success: 1, failure: 1, skipped: 2 })
expect(results[:userless_access]).to be_failure
expect(results[:userless_access].message).to eq(i18n_message(:userless_access_denied))
end
diff --git a/modules/storages/spec/common/storages/peripherals/connection_validators/nextcloud/authentication_validator_spec.rb b/modules/storages/spec/common/storages/peripherals/connection_validators/nextcloud/authentication_validator_spec.rb
index 97370e73b37..547620bd4dd 100644
--- a/modules/storages/spec/common/storages/peripherals/connection_validators/nextcloud/authentication_validator_spec.rb
+++ b/modules/storages/spec/common/storages/peripherals/connection_validators/nextcloud/authentication_validator_spec.rb
@@ -48,9 +48,7 @@ module Storages
before { User.current = user }
it "passes when the user has a token and the request works", vcr: "nextcloud/user_query_success" do
- result = validator.call
-
- expect(result.values).to all(be_success)
+ expect(validator.call).to be_success
end
it "returns a warning when there's no token for the current user" do
@@ -87,9 +85,7 @@ module Storages
it "succeeds give the user is provisioned and tokens can be acquired" do
create(:oidc_user_token, user:, extra_audiences: storage.audience)
- result = validator.call
-
- expect(result.values).to all(be_success)
+ expect(validator.call).to be_success
end
describe "error and warning handling" do
@@ -100,7 +96,7 @@ module Storages
expect(result[:non_provisioned_user]).to be_warning
expect(result[:non_provisioned_user].message).to eq(I18n.t(i18n_key(:oidc_non_provisioned_user)))
- state_count = result.values.map { it.state }.tally
+ state_count = result.tally
expect(state_count).to eq({ skipped: 3, warning: 1 })
end
@@ -111,7 +107,7 @@ module Storages
expect(result[:provisioned_user_provider]).to be_warning
expect(result[:provisioned_user_provider].message).to eq(I18n.t(i18n_key(:oidc_non_oidc_user)))
- state_count = result.values.map { it.state }.tally
+ state_count = result.tally
expect(state_count).to eq({ success: 1, skipped: 2, warning: 1 })
end
end
@@ -138,9 +134,7 @@ module Storages
refresh_token: expired_storage_token.refresh_token })
.and_return_json(status: 200, body: { access_token: "NEW_TOKEN" })
- result = validator.call
-
- expect(result.values).to all(be_success)
+ expect(validator.call).to be_success
expect(refresh_request).to have_been_requested.once
end
@@ -176,8 +170,7 @@ module Storages
grant_type: OpenIDConnect::Provider::TOKEN_EXCHANGE_GRANT_TYPE })
.and_return_json(status: 200, body: { access_token: "NEW_TOKEN" })
- result = validator.call
- expect(result.values).to all(be_success)
+ expect(validator.call).to be_success
expect(exchange_request).to have_been_requested.once
end
diff --git a/modules/storages/spec/common/storages/peripherals/connection_validators/nextcloud/base_configuration_validator_spec.rb b/modules/storages/spec/common/storages/peripherals/connection_validators/nextcloud/storage_configuration_validator_spec.rb
similarity index 81%
rename from modules/storages/spec/common/storages/peripherals/connection_validators/nextcloud/base_configuration_validator_spec.rb
rename to modules/storages/spec/common/storages/peripherals/connection_validators/nextcloud/storage_configuration_validator_spec.rb
index a417e9a74b3..be25efca2ae 100644
--- a/modules/storages/spec/common/storages/peripherals/connection_validators/nextcloud/base_configuration_validator_spec.rb
+++ b/modules/storages/spec/common/storages/peripherals/connection_validators/nextcloud/storage_configuration_validator_spec.rb
@@ -35,19 +35,29 @@ module Storages
module Peripherals
module ConnectionValidators
module Nextcloud
- RSpec.describe BaseConfigurationValidator, :webmock do
+ RSpec.describe StorageConfigurationValidator, :webmock do
let(:storage) { create(:nextcloud_storage_with_local_connection, :as_not_automatically_managed) }
subject(:validator) { described_class.new(storage) }
- it "returns a hash with check 'key' as key and a CheckResult as value", vcr: "nextcloud/capabilities_success" do
+ it "returns a GroupValidationResult", vcr: "nextcloud/capabilities_success" do
results = validator.call
- expect(results).to be_a(Hash)
- expect(results.values).to all(be_success)
+ expect(results).to be_a(ValidationGroupResult)
+ expect(results).to be_success
end
- describe "when errors occurs" do
+ describe "possible error scenarios" do
+ context "when the storage is not configured" do
+ let(:storage) { create(:nextcloud_storage) }
+
+ it "the check fails" do
+ results = validator.call
+ expect(results[:storage_configured]).to be_a_failure
+ expect(results[:storage_configured].message).to eq(I18n.t(i18n_key(:not_configured)))
+ end
+ end
+
it "base url could not be reached" do
stub_request(:get, UrlBuilder.url(storage.uri, "/ocs/v2.php/cloud/capabilities"))
.to_return(status: 404, body: "Not Found")
diff --git a/modules/storages/spec/common/storages/peripherals/connection_validators/nextcloud_connection_validator_spec.rb b/modules/storages/spec/common/storages/peripherals/connection_validators/nextcloud_connection_validator_spec.rb
new file mode 100644
index 00000000000..ebae600a5cb
--- /dev/null
+++ b/modules/storages/spec/common/storages/peripherals/connection_validators/nextcloud_connection_validator_spec.rb
@@ -0,0 +1,62 @@
+# frozen_string_literal: true
+
+#-- copyright
+# OpenProject is an open source project management software.
+# Copyright (C) the OpenProject GmbH
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License version 3.
+#
+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+# Copyright (C) 2006-2013 Jean-Philippe Lang
+# Copyright (C) 2010-2013 the ChiliProject Team
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# See COPYRIGHT and LICENSE files for more details.
+#++
+
+require "spec_helper"
+require_module_spec_helper
+
+module Storages
+ module Peripherals
+ module ConnectionValidators
+ RSpec.describe NextcloudValidator, :webmock do
+ it "does not run the AMPF tests if the storage is not automatically managed",
+ vcr: "nextcloud/capabilities_success" do
+ results = described_class.new(storage: create(:nextcloud_storage_with_local_connection)).validate
+
+ expect { results.group(:ampf_configuration) }.to raise_error(KeyError)
+ end
+
+ it "aggregates all the results from the tests", vcr: "nextcloud/capabilities_success" do
+ results = described_class.new(storage: create(:nextcloud_storage_with_local_connection)).validate
+
+ expect(results).to be_warning
+ expect(results.group(:base_configuration)).to be_success
+ expect(results.group(:authentication)).to be_warning
+ end
+
+ it "does not run any further tests if base configuration failed", vcr: "nextcloud/capabilities_invalid_data" do
+ results = described_class.new(storage: create(:nextcloud_storage_with_local_connection)).validate
+
+ expect { results.group(:authentication) }.to raise_error(KeyError)
+ expect { results.group(:ampf_configuration) }.to raise_error(KeyError)
+ end
+ end
+ end
+ end
+end