use of org.onebusaway.federations.FederatedServiceCollection in project onebusaway-application-modules by camsys.
the class FederatedByCoordinateBoundsMethodInvocationHandlerImplTest method test02.
@Test
public void test02() throws Exception {
CoordinateBounds bounds = new CoordinateBounds(0, 1, 2, 3);
CoordinateBoundsTestBean bean = new CoordinateBoundsTestBean();
bean.setBounds(bounds);
SimpleFederatedService mockService = Mockito.mock(SimpleFederatedService.class);
FederatedServiceCollection mockCollection = Mockito.mock(FederatedServiceCollectionImpl.class);
Mockito.when(mockCollection.getServiceForBounds(bounds)).thenReturn(mockService);
Method method = SimpleFederatedService.class.getDeclaredMethod("getValueForCoordinateBoundsTestBean", CoordinateBoundsTestBean.class);
Object[] args = { bean };
FederatedServiceMethodInvocationHandler handler = new FederatedByCoordinateBoundsMethodInvocationHandlerImpl(method, 0, "bounds");
handler.invoke(mockCollection, method, args);
Mockito.verify(mockService).getValueForCoordinateBoundsTestBean(bean);
}
Aggregations