@Test public void shouldCreateFillsShim(){ QueueState queueState = new QueueState(); QueueItem queueItem = new QueueItem(); queueItem.setBpm(80); queueItem.setQueueItemId("itemIdFillzz"); queueState.setQueueItem(queueItem); File hitShim = fillsRenderer.createFillShim(queueState); assertThat(hitShim.exists()).isTrue(); try { FileStructure.deleteSingleFile(hitShim.getPath()); }catch (Exception exception){ System.out.println("FAILED TO CLEANUP"); } assertThat(hitShim.exists()).isFalse(); }
@Override public File createFillShim(QueueState queueState) { String filePath = fileStructure.createShimsDirectory(queueState.getQueueItem().getQueueItemId()); String shimName = createNameForFillShim(); String shimPath = filePath + "/" + shimName; if (new File(shimPath).exists()) { try { FileStructure.deleteFile(new File(shimPath)); } catch (IOException e) { Application.logger.debug("LOG:", e); } } shimGenerator.generateSilence(LoopUtils.getBeatsInSeconds(queueState.getQueueItem().getBpm(), 4), shimPath, 1); return new File(shimPath); }
FillsRenderer implements IFillsRenderer { @Override public File createFillShim(QueueState queueState) { String filePath = fileStructure.createShimsDirectory(queueState.getQueueItem().getQueueItemId()); String shimName = createNameForFillShim(); String shimPath = filePath + "/" + shimName; if (new File(shimPath).exists()) { try { FileStructure.deleteFile(new File(shimPath)); } catch (IOException e) { Application.logger.debug("LOG:", e); } } shimGenerator.generateSilence(LoopUtils.getBeatsInSeconds(queueState.getQueueItem().getBpm(), 4), shimPath, 1); return new File(shimPath); } }
FillsRenderer implements IFillsRenderer { @Override public File createFillShim(QueueState queueState) { String filePath = fileStructure.createShimsDirectory(queueState.getQueueItem().getQueueItemId()); String shimName = createNameForFillShim(); String shimPath = filePath + "/" + shimName; if (new File(shimPath).exists()) { try { FileStructure.deleteFile(new File(shimPath)); } catch (IOException e) { Application.logger.debug("LOG:", e); } } shimGenerator.generateSilence(LoopUtils.getBeatsInSeconds(queueState.getQueueItem().getBpm(), 4), shimPath, 1); return new File(shimPath); }  }
FillsRenderer implements IFillsRenderer { @Override public File createFillShim(QueueState queueState) { String filePath = fileStructure.createShimsDirectory(queueState.getQueueItem().getQueueItemId()); String shimName = createNameForFillShim(); String shimPath = filePath + "/" + shimName; if (new File(shimPath).exists()) { try { FileStructure.deleteFile(new File(shimPath)); } catch (IOException e) { Application.logger.debug("LOG:", e); } } shimGenerator.generateSilence(LoopUtils.getBeatsInSeconds(queueState.getQueueItem().getBpm(), 4), shimPath, 1); return new File(shimPath); }  @Override void render(QueueState queueState); @Override List<Fill> createFillsToRender(List<ProgressionUnit> progressionUnits); @Override File createFillShim(QueueState queueState); String createNameForFillShim(); }
FillsRenderer implements IFillsRenderer { @Override public File createFillShim(QueueState queueState) { String filePath = fileStructure.createShimsDirectory(queueState.getQueueItem().getQueueItemId()); String shimName = createNameForFillShim(); String shimPath = filePath + "/" + shimName; if (new File(shimPath).exists()) { try { FileStructure.deleteFile(new File(shimPath)); } catch (IOException e) { Application.logger.debug("LOG:", e); } } shimGenerator.generateSilence(LoopUtils.getBeatsInSeconds(queueState.getQueueItem().getBpm(), 4), shimPath, 1); return new File(shimPath); }  @Override void render(QueueState queueState); @Override List<Fill> createFillsToRender(List<ProgressionUnit> progressionUnits); @Override File createFillShim(QueueState queueState); String createNameForFillShim();  }