Skip to content

Commit

Permalink
✅ add test for no language
Browse files Browse the repository at this point in the history
  • Loading branch information
McPringle committed Nov 14, 2024
1 parent 3473285 commit b52de73
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,20 @@ void unknownLanguage() {
final var session = sessions.getFirst();
assertEquals(Language.UNKNOWN, session.language());
}

@Test
void noLanguage() {
final var configuration = mock(Configuration.class);
final var sessionizeConfig = new SessionizeConfig("1",
"file:src/test/resources/sessionize-no-language.json?eventId=%s",
"file:src/test/resources/sessionize-speakers.json?eventId=%s");
when(configuration.getSessionize()).thenReturn(sessionizeConfig);

final var sessionizePlugin = new SessionizePlugin(configuration);
final var sessions = sessionizePlugin.getSessions().toList();
assertEquals(1, sessions.size());

final var session = sessions.getFirst();
assertEquals(Language.UNKNOWN, session.language());
}
}
31 changes: 31 additions & 0 deletions src/test/resources/sessionize-no-language.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[
{
"groupId": null,
"groupName": "All",
"sessions": [
{
"id": "1",
"title": "Lorem ipsum dolor sit amet",
"startsAt": "2024-01-01T09:45:00",
"endsAt": "2024-01-01T10:00:00",
"speakers": [
{
"id": "e5da722a-b022-4556-b665-467e54baf9f4",
"name": "Walter White"
},
{
"id": "2c9d3dc1-9f79-457f-b4b3-42ce42f6366a",
"name": "Jesse Pinkman"
}
],
"categories": [
{
"id": 12345,
"name": "Foobar"
}
],
"room": "Room A"
}
]
}
]

0 comments on commit b52de73

Please sign in to comment.