@Test public void testFirmwareBundleGetNextImageOneImage() throws ImageParsingException, OADException { images.add(imageA); bundle = new FirmwareBundle(images); assertThat(bundle.getNextImage()).isEqualTo(imageA); try { bundle.getNextImage(); fail("Expected OAD Exception"); } catch (OADException e) { } }
public FirmwareImage getNextImage() throws OADException { if (imageCounter >= images.size() ) { throw new OADException("Firmware bundle is exhausted, all images rejected"); } FirmwareImage i = images.get(imageCounter); imageCounter++; return i; }
FirmwareBundle { public FirmwareImage getNextImage() throws OADException { if (imageCounter >= images.size() ) { throw new OADException("Firmware bundle is exhausted, all images rejected"); } FirmwareImage i = images.get(imageCounter); imageCounter++; return i; } }
FirmwareBundle { public FirmwareImage getNextImage() throws OADException { if (imageCounter >= images.size() ) { throw new OADException("Firmware bundle is exhausted, all images rejected"); } FirmwareImage i = images.get(imageCounter); imageCounter++; return i; } FirmwareBundle(List<FirmwareImage> images); }
FirmwareBundle { public FirmwareImage getNextImage() throws OADException { if (imageCounter >= images.size() ) { throw new OADException("Firmware bundle is exhausted, all images rejected"); } FirmwareImage i = images.get(imageCounter); imageCounter++; return i; } FirmwareBundle(List<FirmwareImage> images); long version(); FirmwareImage getNextImage(); void reset(); }
FirmwareBundle { public FirmwareImage getNextImage() throws OADException { if (imageCounter >= images.size() ) { throw new OADException("Firmware bundle is exhausted, all images rejected"); } FirmwareImage i = images.get(imageCounter); imageCounter++; return i; } FirmwareBundle(List<FirmwareImage> images); long version(); FirmwareImage getNextImage(); void reset();  }