@Test
  public void testIsRequestExpired() {
    RequestInfo requestInfo = Mockito.mock(RequestInfo.class);
    Mockito.when(requestInfo.isRequestReceivedByNetworkLayer()).thenReturn(true);
    Mockito.when(requestInfo.getRequestEnqueueTime()).thenReturn(1L);
    Mockito.when(requestInfo.getNetworkTimeOutMs()).thenReturn(10L);
    assertEquals(RouterUtils.RouterRequestExpiryReason.ROUTER_SERVER_NETWORK_CLIENT_TIMEOUT,
        RouterUtils.isRequestExpired(requestInfo, 12L));

    Mockito.when(requestInfo.isRequestReceivedByNetworkLayer()).thenReturn(false);
    Mockito.when(requestInfo.getRequestEnqueueTime()).thenReturn(1L);
    Mockito.when(requestInfo.getRequestCreateTime()).thenReturn(1L);
    Mockito.when(requestInfo.getFinalTimeOutMs()).thenReturn(10L);
    assertEquals(RouterUtils.RouterRequestExpiryReason.ROUTER_REQUEST_TIMEOUT,
        RouterUtils.isRequestExpired(requestInfo, 12L));

    Mockito.when(requestInfo.isRequestReceivedByNetworkLayer()).thenReturn(false);
    Mockito.when(requestInfo.getRequestEnqueueTime()).thenReturn(1L);
    Mockito.when(requestInfo.getRequestCreateTime()).thenReturn(5L);
    Mockito.when(requestInfo.getFinalTimeOutMs()).thenReturn(10L);
    assertEquals(RouterUtils.RouterRequestExpiryReason.NO_TIMEOUT, RouterUtils.isRequestExpired(requestInfo, 12L));
  }
Test {@link RouterUtils#getAccountContainer(AccountService, short, short)}.
ambry-router/src/test/java/com/github/ambry/router/RouterUtilsTest.java