@Test
public void prevLinkParameters()
{

    Mockito.when( schemaService.getDynamicSchema( Mockito.eq( OrganisationUnit.class ) ) ).thenAnswer( invocation -> {
        Schema schema = new Schema( OrganisationUnit.class, "organisationUnit", "organisationUnits" );
        schema.setRelativeApiEndpoint( "/organizationUnits" );
        return schema;
    } );
    Mockito.when( contextService.getRequest() ).thenReturn( request );
    Mockito.when( contextService.getApiPath() ).thenReturn( "/demo/api/456" );
    Mockito.when( contextService.getParameterValuesMap() ).thenAnswer( invocation -> {
        final Map<String, List<String>> map = new HashMap<>();
        map.put( "page", Collections.singletonList( "1" ) );
        map.put( "pageSize", Collections.singletonList( "55" ) );
        map.put( "fields", Collections.singletonList( "id,name,value[id,text]" ) );
        map.put( "value[x]", Arrays.asList( "test1", "test2\u00D8" ) );
        return map;
    } );
    final Pager pager = new Pager( 3, 110 );
    service.generatePagerLinks( pager, OrganisationUnit.class );
    Assert.assertNull( pager.getNextPage() );
    Assert.assertEquals( "/demo/api/456/organizationUnits?page=2&fields=id%2Cname%2Cvalue%5Bid%2Ctext%5D&value%5Bx%5D=test1&value%5Bx%5D=test2%C3%98", pager.getPrevPage() );
}