Provisionr service = mock(Provisionr.class);
Provider provider = newProviderMockWithBuilder();
when(service.getDefaultProvider()).thenReturn(Optional.of(provider));
Pool pool = command.createPoolFromArgumentsAndServiceDefaults(service);
assertThat(pool.getHardware().getBlockDevices()).isEmpty();
command.setBlockDeviceOptions(Lists.newArrayList("/dev/sda2:8", "/dev/sda9:2"));
pool = command.createPoolFromArgumentsAndServiceDefaults(service);
assertThat(pool.getHardware().getBlockDevices()).hasSize(2);
assertThat(pool.getHardware().getBlockDevices().get(0).getSize()).isEqualTo(8);
assertThat(pool.getHardware().getBlockDevices().get(0).getName()).isEqualTo("/dev/sda2");
assertThat(pool.getHardware().getBlockDevices().get(1).getSize()).isEqualTo(2);
assertThat(pool.getHardware().getBlockDevices().get(1).getName()).isEqualTo("/dev/sda9");
command.setBlockDeviceOptions(Lists.newArrayList("/dev/sda1:7"));
pool = command.createPoolFromArgumentsAndServiceDefaults(service);
assertThat(pool.getHardware().getBlockDevices()).hasSize(1);
assertThat(pool.getHardware().getBlockDevices().get(0).getSize()).isEqualTo(7);
command.setBlockDeviceOptions(Lists.newArrayList("this=breaks"));
exception.expect(IllegalArgumentException.class);
pool = command.createPoolFromArgumentsAndServiceDefaults(service);