use of org.orcid.core.locale.LocaleManager in project ORCID-Source by ORCID.
the class PublicV2ApiServiceDelegatorTest method testSearchByQueryIllegalStart.
@Test(expected = SearchStartParameterLimitExceededException.class)
public void testSearchByQueryIllegalStart() {
Map<String, List<String>> params = new HashMap<>();
params.put("start", Arrays.asList(Integer.toString(OrcidSearchManager.MAX_SEARCH_START + 20)));
LocaleManager localeManager = Mockito.mock(LocaleManagerImpl.class);
Mockito.when(localeManager.resolveMessage(Mockito.anyString())).thenReturn("a message");
OrcidSecurityManager orcidSecurityManager = Mockito.mock(OrcidSecurityManagerImpl.class);
Mockito.when(orcidSecurityManager.getClientIdFromAPIRequest()).thenReturn(null);
PublicV2ApiServiceDelegatorImpl delegator = new PublicV2ApiServiceDelegatorImpl();
ReflectionTestUtils.setField(delegator, "localeManager", localeManager);
ReflectionTestUtils.setField(delegator, "orcidSecurityManager", orcidSecurityManager);
delegator.searchByQuery(params);
}
Aggregations