VolumeTypeHelper { public VolumeType getType(String type) { if (mapTypes.containsKey(type.toUpperCase())) { return mapTypes.get(type.toUpperCase()); } return VolumeTypeHelper.defaultType; }  @Inject void setTypes(List<VolumeType> types); VolumeType getType(String type);  }
@Test public void testGetTypeBaseImage() throws Exception { VolumeType type = helper.getType("BaseImage"); Assert.assertTrue(type instanceof BaseImage); }
@Test public void testGetTypeDataDisk() throws Exception { VolumeType type = helper.getType("DataDisk"); Assert.assertTrue(type instanceof DataDisk); }
@Test public void testGetTypeIso() throws Exception { VolumeType type = helper.getType("Iso"); Assert.assertTrue(type instanceof Iso); }
@Test public void testGetTypeUnknown() throws Exception { VolumeType type = helper.getType("Unknown"); Assert.assertTrue(type instanceof Unknown); }
@Test public void testGetTypeRootDisk() throws Exception { VolumeType type = helper.getType("RootDisk"); Assert.assertTrue(type instanceof RootDisk); }
@Test public void testGetTypeVolumeTypeBase() throws Exception { VolumeType type = helper.getType("VolumeTypeBase"); Assert.assertTrue(type instanceof VolumeTypeBase); }
@Test public void testGetTypeVolumeString() throws Exception { VolumeType type = helper.getType("String"); Assert.assertTrue(type instanceof Unknown); }
@Test(expected = NullPointerException.class) public void testGetTypeVolumeNull() throws Exception { helper.getType(null); }