@Test
    public void testNotEnoughBrokers() {
        MockRandom random = new MockRandom();
        StripedReplicaPlacer placer = new StripedReplicaPlacer(random);
        assertEquals("The target replication factor of 3 cannot be reached because only " +
            "2 broker(s) are registered.",
            assertThrows(InvalidReplicationFactorException.class,
                () -> place(placer, 0, 1, (short) 3, Arrays.asList(
                    new UsableBroker(11, Optional.of("1"), false),
                    new UsableBroker(10, Optional.of("1"), false)))).getMessage());
    }
Test that we will place on the fenced replica if we need to.
metadata/src/test/java/org/apache/kafka/metadata/placement/StripedReplicaPlacerTest.java