### Question:
AkkaProtocolServer implements ProtocolServer { @Override public CompletableFuture<Void> expose(ExposedThing thing) { log.info("AkkaServer exposes '{}'", thing.getId()); if (triple == null) { return failedFuture(new ProtocolServerException("Unable to expose thing before AkkaServer has been started")); } triple.second().put(thing.getId(), thing); Duration timeout = Duration.ofSeconds(10); return pattern.ask(triple.third(), new ThingsActor.Expose(thing.getId()), timeout) .thenRun(() -> log.debug("AkkaServer has '{}' exposed", thing.getId())) .toCompletableFuture(); } AkkaProtocolServer(Config config); protected  AkkaProtocolServer(RefCountResource<Triple<ActorSystem, Map<String, ExposedThing>, ActorRef>> actorSystemProvider,
                                 AkkaProtocolPattern pattern); protected  AkkaProtocolServer(RefCountResource<Triple<ActorSystem, Map<String, ExposedThing>, ActorRef>> actorSystemProvider,
                                 AkkaProtocolPattern pattern,
                                 Triple<ActorSystem, Map<String, ExposedThing>, ActorRef> triple); @Override String toString(); @Override CompletableFuture<Void> start(Servient servient); @Override CompletableFuture<Void> stop(); @Override CompletableFuture<Void> expose(ExposedThing thing); @Override CompletableFuture<Void> destroy(ExposedThing thing); @Override URI getDirectoryUrl(); @Override URI getThingUrl(String id); ActorSystem getActorSystem();  }### Answer:
@Test public void exposeShouldSendExposeMessageToThingsActor() { when(triple.second()).thenReturn(things); when(triple.third()).thenReturn(thingsActor); when(pattern.ask(any(ActorRef.class), any(), any())).thenReturn(completionStage); when(completionStage.thenRun(any())).thenReturn(completionStage); AkkaProtocolServer server = new AkkaProtocolServer(actorSystemProvider, pattern, triple); server.expose(thing); verify(pattern, timeout(1 * 1000L)).ask(eq(thingsActor), any(ThingsActor.Expose.class), any()); }