use of org.openstack4j.model.network.RouterInterface in project camel by apache.
the class RouterProducerTest method attachTest.
@Test
public void attachTest() throws Exception {
final String routerID = "myRouterID";
final String subnetId = "subnet";
final RouterInterface ifce = new NeutronRouterInterface(subnetId, null);
when(routerService.attachInterface(anyString(), any(AttachInterfaceType.class), anyString())).thenReturn(ifce);
msg.setHeader(OpenstackConstants.OPERATION, NeutronConstants.ATTACH_INTERFACE);
msg.setHeader(NeutronConstants.ROUTER_ID, routerID);
msg.setHeader(NeutronConstants.SUBNET_ID, subnetId);
msg.setHeader(NeutronConstants.ITERFACE_TYPE, AttachInterfaceType.SUBNET);
producer.process(exchange);
ArgumentCaptor<String> routerC = ArgumentCaptor.forClass(String.class);
ArgumentCaptor<AttachInterfaceType> itfType = ArgumentCaptor.forClass(AttachInterfaceType.class);
ArgumentCaptor<String> subnetC = ArgumentCaptor.forClass(String.class);
verify(routerService).attachInterface(routerC.capture(), itfType.capture(), subnetC.capture());
assertEquals(routerID, routerC.getValue());
assertEquals(AttachInterfaceType.SUBNET, itfType.getValue());
assertEquals(subnetId, subnetC.getValue());
assertEquals(ifce, msg.getBody(RouterInterface.class));
}
Aggregations