use of org.onebusaway.federations.EntityIdTestBean in project onebusaway-application-modules by camsys.
the class FederatedByAgencyIdMethodInvocationHandlerImplTest method testPropertyExpression.
@Test
public void testPropertyExpression() throws Exception {
SimpleFederatedService mockService = Mockito.mock(SimpleFederatedService.class);
FederatedServiceCollection mockCollection = Mockito.mock(FederatedServiceCollectionImpl.class);
Mockito.when(mockCollection.getServiceForAgencyId("agency")).thenReturn(mockService);
Method method = SimpleFederatedService.class.getDeclaredMethod("getValueForValueBean", EntityIdTestBean.class);
EntityIdTestBean value = new EntityIdTestBean("agency_entity");
Object[] args = { value };
FederatedServiceMethodInvocationHandler handler = new FederatedByEntityIdMethodInvocationHandlerImpl(method, 0, "id");
handler.invoke(mockCollection, method, args);
Mockito.verify(mockService).getValueForValueBean(value);
}
Aggregations