@Test public void testRoute() throws BucketStatsException { String route = "default"; BucketId bucketId = bucketIdFactory.getBucketId(new DocumentId("id:ns:type::another")); GetBucketListReply reply = new GetBucketListReply(); reply.getBuckets().add(new GetBucketListReply.BucketInfo(bucketId, "I like turtles!")); when(mockedSession.syncSend(any())).thenReturn(reply); BucketStatsRetriever retriever = new BucketStatsRetriever(mockedFactory, route, t -> {}); retriever.retrieveBucketList(new BucketId(0), bucketSpace); verify(mockedSession).setRoute(eq(route)); }
public List<GetBucketListReply.BucketInfo> retrieveBucketList(BucketId bucketId, String bucketSpace) throws BucketStatsException { GetBucketListMessage msg = new GetBucketListMessage(bucketId, bucketSpace); GetBucketListReply bucketListReply = sendMessage(msg, GetBucketListReply.class); return bucketListReply.getBuckets(); }
BucketStatsRetriever { public List<GetBucketListReply.BucketInfo> retrieveBucketList(BucketId bucketId, String bucketSpace) throws BucketStatsException { GetBucketListMessage msg = new GetBucketListMessage(bucketId, bucketSpace); GetBucketListReply bucketListReply = sendMessage(msg, GetBucketListReply.class); return bucketListReply.getBuckets(); } }
BucketStatsRetriever { public List<GetBucketListReply.BucketInfo> retrieveBucketList(BucketId bucketId, String bucketSpace) throws BucketStatsException { GetBucketListMessage msg = new GetBucketListMessage(bucketId, bucketSpace); GetBucketListReply bucketListReply = sendMessage(msg, GetBucketListReply.class); return bucketListReply.getBuckets(); } BucketStatsRetriever(
            DocumentAccessFactory documentAccessFactory,
            String route,
            ShutdownHookRegistrar registrar); }
BucketStatsRetriever { public List<GetBucketListReply.BucketInfo> retrieveBucketList(BucketId bucketId, String bucketSpace) throws BucketStatsException { GetBucketListMessage msg = new GetBucketListMessage(bucketId, bucketSpace); GetBucketListReply bucketListReply = sendMessage(msg, GetBucketListReply.class); return bucketListReply.getBuckets(); } BucketStatsRetriever(
            DocumentAccessFactory documentAccessFactory,
            String route,
            ShutdownHookRegistrar registrar); BucketId getBucketIdForType(ClientParameters.SelectionType type, String id); String retrieveBucketStats(ClientParameters.SelectionType type, String id, BucketId bucketId, String bucketSpace); List<GetBucketListReply.BucketInfo> retrieveBucketList(BucketId bucketId, String bucketSpace); }
BucketStatsRetriever { public List<GetBucketListReply.BucketInfo> retrieveBucketList(BucketId bucketId, String bucketSpace) throws BucketStatsException { GetBucketListMessage msg = new GetBucketListMessage(bucketId, bucketSpace); GetBucketListReply bucketListReply = sendMessage(msg, GetBucketListReply.class); return bucketListReply.getBuckets(); } BucketStatsRetriever(
            DocumentAccessFactory documentAccessFactory,
            String route,
            ShutdownHookRegistrar registrar); BucketId getBucketIdForType(ClientParameters.SelectionType type, String id); String retrieveBucketStats(ClientParameters.SelectionType type, String id, BucketId bucketId, String bucketSpace); List<GetBucketListReply.BucketInfo> retrieveBucketList(BucketId bucketId, String bucketSpace);  }