### Question:
HadoopAuthFilter extends
    org.apache.hadoop.security.authentication.server.AuthenticationFilter { @Override protected Properties getConfiguration(String configPrefix, FilterConfig filterConfig) throws ServletException { GatewayServices services = GatewayServer.getGatewayServices(); AliasService aliasService = services.getService(ServiceType.ALIAS_SERVICE); return getConfiguration(aliasService, configPrefix, filterConfig); }  @Override void init(FilterConfig filterConfig); @Override void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain);  }### Answer:
@Test public void testHadoopAuthFilterAliases() throws Exception { String aliasKey = "signature.secret"; String aliasConfigKey = "${ALIAS=" + aliasKey + "}"; String aliasValue = "password"; String clusterName = "Sample"; Topology topology = new Topology(); topology.setName(clusterName); AliasService as = createMock(AliasService.class); expect(as.getPasswordFromAliasForCluster(clusterName, aliasKey)) .andReturn(aliasValue.toCharArray()).atLeastOnce(); String configPrefix = "hadoop.auth.config."; Map<String, String> props = new HashMap<>(); props.put("clusterName", clusterName); props.put(configPrefix + "signature.secret", aliasConfigKey); props.put(configPrefix + "test", "abc"); FilterConfig filterConfig = createMock(FilterConfig.class); expect(filterConfig.getInitParameter(anyString())) .andAnswer(() -> props.get(getCurrentArguments()[0].toString())) .atLeastOnce(); expect(filterConfig.getInitParameterNames()).andReturn(Collections.enumeration(props.keySet())).atLeastOnce(); replay(filterConfig, as); HadoopAuthFilter hadoopAuthFilter = new HadoopAuthFilter(); Properties configuration = hadoopAuthFilter.getConfiguration(as, configPrefix, filterConfig); assertEquals(aliasValue, configuration.getProperty(aliasKey)); assertEquals("abc", configuration.getProperty("test")); verify(filterConfig, as); }