@Test
  public void getFrontendRestRequestServiceFactoryWithBadInputTest() throws Exception {
    // dud properties. server should pick up defaults
    Properties properties = new Properties();
    VerifiableProperties verifiableProperties = new VerifiableProperties(properties);
    ClusterMap clusterMap = new MockClusterMap();
    FrontendTestIdConverterFactory converterFactory = new FrontendTestIdConverterFactory();
    Router router = new InMemoryRouter(verifiableProperties, clusterMap, converterFactory);
    AccountService accountService = new InMemAccountService(false, true);

    // VerifiableProperties null.
    try {
      new FrontendRestRequestServiceFactory(null, clusterMap, router, accountService);
      fail("Instantiation should have failed because VerifiableProperties was null");
    } catch (NullPointerException e) {
      // expected. Nothing to do.
    }

    // ClusterMap null.
    try {
      new FrontendRestRequestServiceFactory(verifiableProperties, null, router, accountService);
      fail("Instantiation should have failed because ClusterMap was null");
    } catch (NullPointerException e) {
      // expected. Nothing to do.
    }

    // Router null.
    try {
      new FrontendRestRequestServiceFactory(verifiableProperties, clusterMap, null, accountService);
      fail("Instantiation should have failed because Router was null");
    } catch (NullPointerException e) {
      // expected. Nothing to do.
    }

    // AccountService null.
    try {
      new FrontendRestRequestServiceFactory(verifiableProperties, clusterMap, router, null);
      fail("Instantiation should have failed because AccountService was null");
    } catch (NullPointerException e) {
      // expected. Nothing to do.
    }
  }
Tests instantiation of {@link FrontendRestRequestServiceFactory} with bad input.
@throws Exception
ambry-frontend/src/test/java/com/github/ambry/frontend/FrontendRestRequestServiceFactoryTest.java