@Test
  public void testGetSSPMetadata() {
    SystemStreamPartition streamPartition0 = new SystemStreamPartition(SYSTEM, STREAM, new Partition(0));
    SystemStreamPartition streamPartition1 = new SystemStreamPartition(SYSTEM, STREAM, new Partition(1));
    SystemStreamPartition otherStreamPartition0 = new SystemStreamPartition(SYSTEM, OTHER_STREAM, new Partition(0));
    SystemAdmin systemAdmin = mock(MySystemAdmin.class);
    SystemStreamMetadata.SystemStreamPartitionMetadata streamPartition0Metadata =
        new SystemStreamMetadata.SystemStreamPartitionMetadata("1", "2", "3");
    SystemStreamMetadata.SystemStreamPartitionMetadata streamPartition1Metadata =
        new SystemStreamMetadata.SystemStreamPartitionMetadata("11", "12", "13");
    SystemStreamMetadata.SystemStreamPartitionMetadata otherStreamPartition0Metadata =
        new SystemStreamMetadata.SystemStreamPartitionMetadata("21", "22", "23");
    when(systemAdmin.getSystemStreamMetadata(ImmutableSet.of(STREAM, OTHER_STREAM))).thenReturn(ImmutableMap.of(
        STREAM, new SystemStreamMetadata(STREAM, ImmutableMap.of(
            new Partition(0), streamPartition0Metadata,
            new Partition(1), streamPartition1Metadata)),
        OTHER_STREAM, new SystemStreamMetadata(OTHER_STREAM, ImmutableMap.of(
            new Partition(0), otherStreamPartition0Metadata))));
    Set<SystemStreamPartition> ssps = ImmutableSet.of(streamPartition0, streamPartition1, otherStreamPartition0);
    when(systemAdmin.getSSPMetadata(ssps)).thenCallRealMethod();
    Map<SystemStreamPartition, SystemStreamMetadata.SystemStreamPartitionMetadata> expected = ImmutableMap.of(
        streamPartition0, streamPartition0Metadata,
        streamPartition1, streamPartition1Metadata,
        otherStreamPartition0, otherStreamPartition0Metadata);
    assertEquals(expected, systemAdmin.getSSPMetadata(ssps));
    verify(systemAdmin).getSystemStreamMetadata(ImmutableSet.of(STREAM, OTHER_STREAM));
  }
Given some SSPs, getSSPMetadata should delegate to getSystemStreamMetadata and properly extract the results for the
requested SSPs.
samza-api/src/test/java/org/apache/samza/system/TestSystemAdmin.java