-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3948 from MDeLuise/fix-mfa-api
Fix error while retrieving MFA option from REST API
- Loading branch information
Showing
5 changed files
with
119 additions
and
20 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
...egration/src/test/java/org/eclipse/kapua/integration/service/user/RunUserMfaUnitTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2022 Eurotech and/or its affiliates and others | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Eurotech - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.kapua.integration.service.user; | ||
|
||
import io.cucumber.junit.Cucumber; | ||
import io.cucumber.junit.CucumberOptions; | ||
import org.junit.runner.RunWith; | ||
|
||
@RunWith(Cucumber.class) | ||
@CucumberOptions( | ||
features = { "classpath:features/user/UserMfaUnitTests.feature" | ||
}, | ||
glue = {"org.eclipse.kapua.service.security.test", | ||
"org.eclipse.kapua.service.authorization.steps", | ||
"org.eclipse.kapua.service.authentication.steps", | ||
"org.eclipse.kapua.service.user.steps", | ||
"org.eclipse.kapua.service.account.steps", | ||
"org.eclipse.kapua.qa.common" | ||
}, | ||
plugin = {"pretty", | ||
"html:target/cucumber/UserProfile", | ||
"json:target/UserProfile_cucumber.json" | ||
}, | ||
monochrome = true) | ||
public class RunUserMfaUnitTest { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
qa/integration/src/test/resources/features/user/UserMfaUnitTests.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
############################################################################### | ||
# Copyright (c) 2017, 2022 Eurotech and/or its affiliates and others | ||
# | ||
# This program and the accompanying materials are made | ||
# available under the terms of the Eclipse Public License 2.0 | ||
# which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 | ||
# | ||
# Contributors: | ||
# Eurotech - initial API and implementation | ||
############################################################################### | ||
@user | ||
@userCredentials | ||
@env_none | ||
|
||
Feature: Feature file for testing Password user credential | ||
This feature file provides test scenarios for user password credential. | ||
|
||
@setup | ||
Scenario: Init Security Context for all scenarios | ||
Given Init Jaxb Context | ||
And Init Security Context | ||
|
||
Scenario: Find mfa of the user | ||
Creating a new user "kapua-a" in kapua-sys account and enabled mfa. | ||
After that login as "kapua-a" user and find the mfa of myself. | ||
No exception should be thrown. | ||
|
||
When I login as user with name "kapua-sys" and password "kapua-password" | ||
And I select account "kapua-sys" | ||
And A generic user | ||
| name | displayName | email | phoneNumber | status | userType | | ||
| kapua-a | Kapua User a | kapua_a@kapua.com | +386 31 321 123 | ENABLED | INTERNAL | | ||
And I add credentials | ||
| name | password | enabled | | ||
| kapua-a | ToManySecrets123# | true | | ||
And Add permissions to the last created user | ||
| domain | action | | ||
| credential | read | | ||
| credential | write | | ||
And I logout | ||
And I login as user with name "kapua-a" and password "ToManySecrets123#" | ||
And I enable mfa | ||
Then mfa repository can get mfa for user "kapua-a" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters