@Test public void shouldExtractCorrectTrackName(){ String expectedPrefix = "amin7_cmaj_fdom7_gdim_80_null_"; String expectedSuffix = ".wav"; DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd"); Date date = new Date(); String expectedDate = dateFormat.format(date).replace("/", "-"); expectedPrefix = expectedPrefix + expectedDate + "_"; String trackName = stationTrackGenerator.extractTrackName(queueState); assertThat(trackName).contains(expectedPrefix); assertThat(trackName).contains(expectedSuffix); }
public String extractTrackName(QueueState queueState){ final List<ProgressionUnit> progressions = queueState.getStructure(); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(extractFirstChord(progressions)); stringBuilder.append("_"); stringBuilder.append(extractSecondChord(progressions)); stringBuilder.append("_"); stringBuilder.append(extractSecondLastChord(progressions)); stringBuilder.append("_"); stringBuilder.append(extractLastChord(progressions)); stringBuilder.append("_"); stringBuilder.append(queueState.getQueueItem().getBpm()); stringBuilder.append("_"); stringBuilder.append(extractSongKey()); stringBuilder.append("_"); stringBuilder.append(createTimeStamp()); stringBuilder.append("_"); stringBuilder.append(createUIDWithFileType()); return stringBuilder.toString(); }
StationTrackGenerator { public String extractTrackName(QueueState queueState){ final List<ProgressionUnit> progressions = queueState.getStructure(); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(extractFirstChord(progressions)); stringBuilder.append("_"); stringBuilder.append(extractSecondChord(progressions)); stringBuilder.append("_"); stringBuilder.append(extractSecondLastChord(progressions)); stringBuilder.append("_"); stringBuilder.append(extractLastChord(progressions)); stringBuilder.append("_"); stringBuilder.append(queueState.getQueueItem().getBpm()); stringBuilder.append("_"); stringBuilder.append(extractSongKey()); stringBuilder.append("_"); stringBuilder.append(createTimeStamp()); stringBuilder.append("_"); stringBuilder.append(createUIDWithFileType()); return stringBuilder.toString(); } }
StationTrackGenerator { public String extractTrackName(QueueState queueState){ final List<ProgressionUnit> progressions = queueState.getStructure(); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(extractFirstChord(progressions)); stringBuilder.append("_"); stringBuilder.append(extractSecondChord(progressions)); stringBuilder.append("_"); stringBuilder.append(extractSecondLastChord(progressions)); stringBuilder.append("_"); stringBuilder.append(extractLastChord(progressions)); stringBuilder.append("_"); stringBuilder.append(queueState.getQueueItem().getBpm()); stringBuilder.append("_"); stringBuilder.append(extractSongKey()); stringBuilder.append("_"); stringBuilder.append(createTimeStamp()); stringBuilder.append("_"); stringBuilder.append(createUIDWithFileType()); return stringBuilder.toString(); }  }
StationTrackGenerator { public String extractTrackName(QueueState queueState){ final List<ProgressionUnit> progressions = queueState.getStructure(); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(extractFirstChord(progressions)); stringBuilder.append("_"); stringBuilder.append(extractSecondChord(progressions)); stringBuilder.append("_"); stringBuilder.append(extractSecondLastChord(progressions)); stringBuilder.append("_"); stringBuilder.append(extractLastChord(progressions)); stringBuilder.append("_"); stringBuilder.append(queueState.getQueueItem().getBpm()); stringBuilder.append("_"); stringBuilder.append(extractSongKey()); stringBuilder.append("_"); stringBuilder.append(createTimeStamp()); stringBuilder.append("_"); stringBuilder.append(createUIDWithFileType()); return stringBuilder.toString(); }  String extractTrackName(QueueState queueState); }
StationTrackGenerator { public String extractTrackName(QueueState queueState){ final List<ProgressionUnit> progressions = queueState.getStructure(); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(extractFirstChord(progressions)); stringBuilder.append("_"); stringBuilder.append(extractSecondChord(progressions)); stringBuilder.append("_"); stringBuilder.append(extractSecondLastChord(progressions)); stringBuilder.append("_"); stringBuilder.append(extractLastChord(progressions)); stringBuilder.append("_"); stringBuilder.append(queueState.getQueueItem().getBpm()); stringBuilder.append("_"); stringBuilder.append(extractSongKey()); stringBuilder.append("_"); stringBuilder.append(createTimeStamp()); stringBuilder.append("_"); stringBuilder.append(createUIDWithFileType()); return stringBuilder.toString(); }  String extractTrackName(QueueState queueState);  }