changed because of #40 (comment)

This commit is contained in:
Miriam Baglioni 2020-08-13 12:19:15 +02:00
parent 04a3e1ab38
commit fd48ae3b85
1 changed files with 11 additions and 10 deletions

View File

@ -7,6 +7,7 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.dom4j.DocumentException;
import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
@ -21,15 +22,15 @@ import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
public class QueryInformationSystemTest { public class QueryInformationSystemTest {
private static final String XQUERY = "for $x in collection('/db/DRIVER/ContextDSResources/ContextDSResourceType') " private static final String XQUERY = "for $x in collection('/db/DRIVER/ContextDSResources/ContextDSResourceType') "
+ +
" where $x//CONFIGURATION/context[./@type='community' or ./@type='ri'] " + " where $x//CONFIGURATION/context[./@type='community' or ./@type='ri'] " +
" and ($x//context/param[./@name = 'status']/text() = 'manager' or $x//context/param[./@name = 'status']/text() = 'all') " " and ($x//context/param[./@name = 'status']/text() = 'manager' or $x//context/param[./@name = 'status']/text() = 'all') "
+ +
" return " + " return " +
"<community> " + "<community> " +
"{$x//CONFIGURATION/context/@id}" + "{$x//CONFIGURATION/context/@id}" +
"{$x//CONFIGURATION/context/@label}" + "{$x//CONFIGURATION/context/@label}" +
"</community>"; "</community>";
List<String> communityMap = Arrays List<String> communityMap = Arrays
.asList( .asList(
@ -65,7 +66,7 @@ public class QueryInformationSystemTest {
private Map<String, String> map; private Map<String, String> map;
@BeforeEach @BeforeEach
public void setUp() throws ISLookUpException { public void setUp() throws ISLookUpException, DocumentException {
lenient().when(isLookUpService.quickSearchProfile(XQUERY)).thenReturn(communityMap); lenient().when(isLookUpService.quickSearchProfile(XQUERY)).thenReturn(communityMap);
queryInformationSystem = new QueryInformationSystem(); queryInformationSystem = new QueryInformationSystem();
queryInformationSystem.setIsLookUp(isLookUpService); queryInformationSystem.setIsLookUp(isLookUpService);