@Test @DisplayName("allow to append endpoint providers and remember the last one per label") void appendEndpoint() { Endpoints<String, CommandEnvelope> endpoints = new Endpoints<>(); MessageEndpoint<String, CommandEnvelope> first = noOpEndpoint(); MessageEndpoint<String, CommandEnvelope> second = noOpEndpoint(); LazyEndpoint<String, CommandEnvelope> firstProvider = envelope -> first; LazyEndpoint<String, CommandEnvelope> secondProvider = envelope -> second; InboxLabel label = HANDLE_COMMAND; endpoints.add(label, firstProvider); checkContains(endpoints, label, first); endpoints.add(label, secondProvider); checkContains(endpoints, label, second); }
void add(InboxLabel label, LazyEndpoint<I, M> lazyEndpoint) { endpoints.put(label, lazyEndpoint); }
Endpoints { void add(InboxLabel label, LazyEndpoint<I, M> lazyEndpoint) { endpoints.put(label, lazyEndpoint); } }
Endpoints { void add(InboxLabel label, LazyEndpoint<I, M> lazyEndpoint) { endpoints.put(label, lazyEndpoint); }  }
Endpoints { void add(InboxLabel label, LazyEndpoint<I, M> lazyEndpoint) { endpoints.put(label, lazyEndpoint); }   }
Endpoints { void add(InboxLabel label, LazyEndpoint<I, M> lazyEndpoint) { endpoints.put(label, lazyEndpoint); }    }