### Question:
Alias { public static AbstractAliasRequest list(final KnoxSession session) { return new ListRequest(session); }  static AbstractAliasRequest list(final KnoxSession session); static AbstractAliasRequest list(final KnoxSession session,
                                          final String      clusterName); static AbstractAliasRequest add(final KnoxSession session, final String alias, final String pwd); static AbstractAliasRequest add(final KnoxSession session,
                                         final String      clusterName,
                                         final String      alias,
                                         final String      pwd); static AbstractAliasRequest remove(final KnoxSession session, final String alias); static AbstractAliasRequest remove(final KnoxSession session,
                                            final String      clusterName,
                                            final String      alias);  }### Answer:
@Test public void testListGatewayAliases() { KnoxSession session = null; try { session = createMockKnoxSession(); } catch (Exception e) { fail(e.getMessage()); } final String expectedEndpointPath = session.base() + AbstractAliasRequest.SERVICE_PATH + "/" + AbstractAliasRequest.GATEWAY_CLUSTER_NAME; AbstractAliasRequest request = Alias.list(session); assertTrue(request instanceof ListRequest); assertEquals("Endpoint mismatch", expectedEndpointPath, request.getRequestURI().toString()); Callable callable = request.callable(); try { callable.call(); } catch (Exception e) { } assertEquals("Unexpected HTTP method.", HttpGet.METHOD_NAME, request.getRequest().getMethod()); }
@Test public void testListClusterAliases() { KnoxSession session = null; try { session = createMockKnoxSession(); } catch (Exception e) { fail(e.getMessage()); } final String clusterName = "myCluster"; final String expectedEndpointPath = session.base() + AbstractAliasRequest.SERVICE_PATH + "/" + clusterName; AbstractAliasRequest request = Alias.list(session, clusterName); assertTrue(request instanceof ListRequest); assertEquals("Endpoint mismatch", expectedEndpointPath, request.getRequestURI().toString()); Callable callable = request.callable(); try { callable.call(); } catch (Exception e) { } assertEquals("Unexpected HTTP method.", HttpGet.METHOD_NAME, request.getRequest().getMethod()); }