Skip to content

Commit c8cc067

Browse files
committed
test(appserver): define injectable mapping store contract
1 parent 371719b commit c8cc067

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

‎src/test/java/io/github/easy4j/codex/appserver/CodexAppServerClientTest.java‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,30 @@ void shouldExposeSecureDefaults() {
4646
assertEquals(1000, config.getMaxSessionMappings());
4747
}
4848

49+
50+
@Test
51+
void shouldAcceptInjectedThreadMappingStore() {
52+
ThreadMappingStore store = new ThreadMappingStore() {
53+
@Override
54+
public String get(String sessionKey) {
55+
return null;
56+
}
57+
58+
@Override
59+
public void put(String sessionKey, String threadId) {
60+
}
61+
62+
@Override
63+
public void remove(String sessionKey) {
64+
}
65+
};
66+
67+
try (CodexAppServerClient client =
68+
new CodexAppServerClient(configWithUrl("ws://localhost:8081"), store)) {
69+
assertNotNull(client);
70+
}
71+
}
72+
4973
@Test
5074
void shouldRejectNullRequestAndBlankPrompt() {
5175
try (CodexAppServerClient client = new CodexAppServerClient(configWithUrl("ws://localhost:8081"))) {

0 commit comments

Comments
 (0)