SinglePartitionWithoutOffsetsSystemAdmin implements SystemAdmin { @Override public Map<String, SystemStreamMetadata> getSystemStreamMetadata(Set<String> streamNames) { Map<String, SystemStreamMetadata> metadata = new HashMap<String, SystemStreamMetadata>(); for (String streamName : streamNames) { metadata.put(streamName, new SystemStreamMetadata(streamName, FAKE_PARTITION_METADATA)); } return metadata; }  @Override Map<String, SystemStreamMetadata> getSystemStreamMetadata(Set<String> streamNames); @Override Map<SystemStreamPartition, String> getOffsetsAfter(Map<SystemStreamPartition, String> offsets); @Override Integer offsetComparator(String offset1, String offset2);  }
@Test public void testShouldGetASinglePartition() { SinglePartitionWithoutOffsetsSystemAdmin admin = new SinglePartitionWithoutOffsetsSystemAdmin(); Set<String> streamNames = new HashSet<String>(); streamNames.add("a"); streamNames.add("b"); Map<String, SystemStreamMetadata> metadata = admin.getSystemStreamMetadata(streamNames); assertEquals(2, metadata.size()); SystemStreamMetadata metadata1 = metadata.get("a"); SystemStreamMetadata metadata2 = metadata.get("b"); assertEquals(1, metadata1.getSystemStreamPartitionMetadata().size()); assertEquals(1, metadata2.getSystemStreamPartitionMetadata().size()); assertNull(metadata.get(new SystemStreamPartition("test-system", "c", new Partition(0)))); }