Skip to content

Commit

Permalink
♻️ complete refactor and redesign to fit perfectly on FullHD monitors
Browse files Browse the repository at this point in the history
Signed-off-by: Marcus Fihlon <[email protected]>
  • Loading branch information
McPringle committed Mar 26, 2024
1 parent b1a17d8 commit 68100e1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
*/
package swiss.fihlon.apus.service;

import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.RandomUtils;
import org.springframework.stereotype.Service;
import swiss.fihlon.apus.conference.Session;

Expand Down Expand Up @@ -81,8 +79,7 @@ private List<Session> generateSampleData() {

LocalDateTime startDate = LocalDateTime.now()
.truncatedTo(ChronoUnit.SECONDS)
.withSecond(0)
.minusMinutes(5);
.withSecond(0);
while (startDate.getMinute() % 5 != 0) {
startDate = startDate.minusMinutes(1);
}
Expand All @@ -98,6 +95,9 @@ private List<Session> generateSampleData() {
final String title = "Test Session #" + index;
final String speaker = "Speaker #" + (counter + 1);
sampleData.add(new Session(id, startDate, endDate, room, title, speaker));
if (sampleData.size() >= sampleDataSize) {
break;
}
}
startDate = startDate.plusMinutes(sampleDuration);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ class ConferenceServiceTest {
@Test
void displaySampleData() {
final ConferenceService conferenceService = new ConferenceService();
assertEquals(5, conferenceService.getRunningSessions().size());
assertEquals(5, conferenceService.getNextSessions().size());
assertEquals(90, conferenceService.getFutureSessions().size());
final var runningSessions = conferenceService.getRunningSessions();
assertEquals(15, runningSessions.size());
final var nextSessions = conferenceService.getNextSessions();
assertEquals(15, nextSessions.size());
final var futureSessions = conferenceService.getFutureSessions();
assertEquals(85, futureSessions.size());
}
}

0 comments on commit 68100e1

Please sign in to comment.