[keycloak-dev] Keycloak - unit tests

Marek Posolda mposolda at redhat.com
Mon Oct 26 09:11:02 EDT 2015


We prefer integration tests as you usually need more things to have 
available. For example for federation, you need realm and user DB and 
you need to have realm configured with federationProvider. There is not 
much you can test within single module, so we have just very simple 
tests in individual modules (like LDAPDnTest or PasswordPolicyTest), but 
most of the stuff is tested in testsuite. For KEYCLOAK-1797 I prefer to 
take a look at LDAPRoleMappingsTest and possibly add new test methods here.

Btv. what's your plan for KEYCLOAK-1797 ? And in your LDAP environment, 
is it often that new role is added as member to some other roles? I 
wonder if we need to always do "deep" search in runtime, or if we can 
instead do it just at some point and rely on Keycloak composite roles . 
If you always need deep search and do something based on it, it will be 
good to have a flag in configuration, which will allow to disable it 
(for performance reasons).

Marek

On 26/10/15 08:55, Andrzej Goławski wrote:
> Hi Marek,
>
> Thanks for reply!
> I saw those test, but personally I prefer unit tests over integrated 
> tests:)
> I really recommend this: https://vimeo.com/80533536
>
> Best Regards,
>  Andrzej
>
> 2015-10-26 8:41 GMT+01:00 Marek Posolda <mposolda at redhat.com 
> <mailto:mposolda at redhat.com>>:
>
>     Hi,
>
>     most of the tests are in the testsuite/integration or
>     testsuite/integration-arquillian, not in the modules itself. For
>     the federation and ldap, you can take a look especially to package
>     org.keycloak.testsuite.federation .
>
>     Marek
>
>     On 25/10/15 21:51, Andrzej Goławski wrote:
>>     Hi everyone!
>>
>>     I decided to implement KEYCLOAK-1797 and started to look at the
>>     code (federation/ldap). I noticed lack of unit tests without
>>     which refactoring may be very error prone. I like writing test so
>>     I can write tests for that part. What are you thinking about it??
>>
>>     Best Regards,
>>      Andrzej
>>
>>
>>     _______________________________________________
>>     keycloak-dev mailing list
>>     keycloak-dev at lists.jboss.org <mailto:keycloak-dev at lists.jboss.org>
>>     https://lists.jboss.org/mailman/listinfo/keycloak-dev
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-dev/attachments/20151026/d46e547b/attachment.html 


More information about the keycloak-dev mailing list