### Question:
HadoopTokenHelper { String getServerPrincipal(final Configuration configuration) throws IOException { return getServerPrincipal(configuration, getServicePrincipal(configuration)); }    }### Answer:
@Test public void testGetMRDelegationTokenRenewer() throws Exception { HadoopTokenHelper hadoopTokenHelper = new HadoopTokenHelper(); Configuration configuration = new Configuration(false); configuration.set("yarn.resourcemanager.address", "localhost:8032"); configuration.set("yarn.resourcemanager.principal", "rm/server.com@KDC.DOMAIN.COM"); assertEquals("yarn setup","rm/server.com@KDC.DOMAIN.COM", hadoopTokenHelper.getServerPrincipal(configuration)); configuration = new Configuration(false); configuration.set("yarn.resourcemanager.address", "rm-ha-uri"); configuration.set("yarn.resourcemanager.principal", "rm/server.com@KDC.DOMAIN.COM"); assertEquals("yarn ha setup","rm", hadoopTokenHelper.getServerPrincipal(configuration)); }