Skip to content

lutece-platform/lutece-test-library-lutece-unit-testing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alerte Line of code Coverage

Library Lutece Unit testing

Introduction

This library provides classes to facilitate the implementation of unit tests.

LuteceTestCase

A class LuteceTestCase to create test classes with all services Lutece initialized (AppPropertiesService, AppPathService, database access ...).



public MyTestCase extends LuteceTestCase
{
...
}
                        

Mock Objects

Mock objects from spring-test can be used. Some utilities are provided.

In the example below, a false application containing false identified user was created to test an AdminFeature subjected to authentication.



MockHttpServletRequest request = new MockHttpServletRequest( );
Utils.registerAdminUserWithRigth( request, new AdminUser( ), RIGHT_MY_FEATURE);
request.addParameter( PARAM_NANE, param_value );

MyPluginJspBean instance = new MyPluginJspBean( );

instance.init( request, RIGHT_MY_FEATURE );
instance.getMyFeature( request );
                        

Maven documentation and reports

generated by xdoc2md - do not edit directly.

About

Library Lutece for Unit Testing

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages