@Test
  public void testBadInputs() throws Exception {
    // subscribe to null topic
    try {
      helixNotifier.subscribe(null, listeners.get(0));
      fail("Should have thrown");
    } catch (IllegalArgumentException e) {
      // expected
    }

    // subscribe using null listener
    try {
      helixNotifier.subscribe(refTopics.get(0), null);
      fail("Should have thrown");
    } catch (IllegalArgumentException e) {
      // expected
    }

    // publish message to a null topic
    try {
      helixNotifier.publish(null, refMessages.get(0));
      fail("Should have thrown");
    } catch (IllegalArgumentException e) {
      // expected
    }

    // publish null message to a topic
    try {
      helixNotifier.publish(refTopics.get(0), null);
      fail("Should have thrown");
    } catch (IllegalArgumentException e) {
      // expected
    }

    // unsubscribe a null listener from a topic
    try {
      helixNotifier.unsubscribe(refTopics.get(0), null);
      fail("Should have thrown");
    } catch (IllegalArgumentException e) {
      // expected
    }

    // unsubscribe a listener from a null topic
    try {
      helixNotifier.unsubscribe(null, listeners.get(0));
      fail("Should have thrown");
    } catch (IllegalArgumentException e) {
      // expected
    }

    // pass null storeConfig to construct a HelixNotifier
    try {
      new HelixNotifier(ZK_CLIENT_CONNECT_STRING, (HelixPropertyStoreConfig) null);
      fail("Should have thrown");
    } catch (IllegalArgumentException e) {
      // expected
    }

    // pass null store to construct a HelixNotifier
    try {
      new HelixNotifier((HelixPropertyStore<ZNRecord>) null);
      fail("Should have thrown");
    } catch (IllegalArgumentException e) {
      // expected
    }
  }
Tests a number of bad inputs.
@throws Exception Any unexpected exceptions.
ambry-commons/src/test/java/com/github/ambry/commons/HelixNotifierTest.java