New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ELY-2171] Add test for MappedRegexRealmMapper #1601
Conversation
Hello, pedro-hos. I'm waiting for one of the admins to verify this patch with /ok-to-test in a comment. |
/** | ||
* @author <a href="mailto:pesilva@redhat.com">Pedro Silva</a> | ||
*/ | ||
public class MappedRegexRealmMapperTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pedro-hos Thank you for PR! Just a minor, we do have many tests in the tests module but since we modularized the project we are trying to place the tests to the appropriate module. So this test can be placed in wildfly-elytron-auth-util since the MappedRegexRealmMapper is there.
|
||
@Test | ||
public void shouldReturnNullForNonNamePrincipalInstance() { | ||
Map<String, String> realmNameMap = Map.of(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pedro-hos |
97a61bc
to
8b9eef8
Compare
@Skyllarr Thank you for your feedback! I've made the changes. I replace the class for the respective project module, and replace the |
auth/util/pom.xml
Outdated
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
--> | ||
<!-- ~ JBoss, Home of Professional Open Source. ~ Copyright 2018 Red Hat, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pedro-hos Thanks for the changes! Just a minor - the formatting of pom.xml file now seems to be off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be you used tabs here, and the project uses spaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I changed the java editor configuration to spaces and forgot to replace it on other editors.
auth/util/pom.xml
Outdated
@@ -18,8 +18,8 @@ | |||
--> | |||
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" | |||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pedro-hos Thank you for update. Just a minor but these 2 lines are still diferently formatted than in other pom files. Otherwise LGMT.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Skyllarr sure, thanks
@pedro-hos Another minor detail, can you please squash the 2 commits together? Thank you. |
[ELY-2171] Add test for MappedRegexRealmMapper [ELY-2171] Add test for MappedRegexRealmMapper [ELY-2171] Add test for MappedRegexRealmMapper wildfly-security#1601 [ELY-2171] Add test for MappedRegexRealmMapper
@@ -0,0 +1,63 @@ | |||
/* | |||
* JBoss, Home of Professional Open Source. | |||
* Copyright 2016 Red Hat, Inc., and individual contributors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2021 :)
public class MappedRegexRealmMapperTest { | ||
|
||
@Test | ||
public void shouldReturnNullForNonNamePrincipalInstance() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We typically use "test" instead "should"
@@ -39,15 +39,15 @@ | |||
<dependency> | |||
<groupId>org.wildfly.security</groupId> | |||
<artifactId>wildfly-elytron-auth</artifactId> | |||
</dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just minor but looks like there are still some whitespace changes in this file and the next one.
[ELY-2171] Add test for MappedRegexRealmMapper [ELY-2171] Add test for MappedRegexRealmMapper [ELY-2171] Add test for MappedRegexRealmMapper wildfly-security#1601 [ELY-2171] Add test for MappedRegexRealmMapper Add test for MappedRegexRealmMapper
@pedro-hos This needs rebase now. |
[ELY-2171] Add test for MappedRegexRealmMapper [ELY-2171] Add test for MappedRegexRealmMapper [ELY-2171] Add test for MappedRegexRealmMapper wildfly-security#1601 [ELY-2171] Add test for MappedRegexRealmMapper Add test for MappedRegexRealmMapper
@@ -60,17 +60,17 @@ | |||
<groupId>org.wildfly.security</groupId> | |||
<artifactId>wildfly-elytron-security-manager-action</artifactId> | |||
</dependency> | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fjuma I checked our other pom files and we do sometimes have these empty lines with spaces and sometimes not. So I think whitespace changes in this pom are ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @pedro-hos!
https://issues.redhat.com/browse/ELY-2171
I hope to create the test on the correct project and package. Also, let me if there are some specific regex and values to test.