Search in sources :

Example 1 with SubnetProducer

use of org.apache.camel.component.openstack.neutron.producer.SubnetProducer in project camel by apache.

the class SubnetProducerTest method setUp.

@Before
public void setUp() {
    producer = new SubnetProducer(endpoint, client);
    when(subnetService.create(any(Subnet.class))).thenReturn(testOSsubnet);
    when(subnetService.get(anyString())).thenReturn(testOSsubnet);
    List<Subnet> getAllList = new ArrayList<>();
    getAllList.add(testOSsubnet);
    getAllList.add(testOSsubnet);
    doReturn(getAllList).when(subnetService).list();
    dummySubnet = createSubnet();
    when(testOSsubnet.getName()).thenReturn(dummySubnet.getName());
    when(testOSsubnet.getNetworkId()).thenReturn(dummySubnet.getNetworkId());
    when(testOSsubnet.getId()).thenReturn(UUID.randomUUID().toString());
}
Also used : ArrayList(java.util.ArrayList) Subnet(org.openstack4j.model.network.Subnet) SubnetProducer(org.apache.camel.component.openstack.neutron.producer.SubnetProducer) Before(org.junit.Before)

Aggregations

ArrayList (java.util.ArrayList)1 SubnetProducer (org.apache.camel.component.openstack.neutron.producer.SubnetProducer)1 Before (org.junit.Before)1 Subnet (org.openstack4j.model.network.Subnet)1