Skip to content

Commit

Permalink
[FLINK-18368][tests] Cleanup Kerberos settings after test.
Browse files Browse the repository at this point in the history
That way successive unit tests that reuse the JVM will not suffer from an
incompatible initial configuration.
  • Loading branch information
StephanEwen committed Jun 19, 2020
1 parent 64f469e commit c8e9d0d
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.security.UserGroupInformation.AuthenticationMethod;
import org.apache.hadoop.security.token.Token;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.mockito.Mockito;
Expand All @@ -49,6 +50,11 @@ public static void setPropertiesToEnableKerberosConfigInit() throws KrbException
sun.security.krb5.Config.refresh();
}

@AfterClass
public static void cleanupHadoopConfigs() throws KrbException {
UserGroupInformation.setConfiguration(new Configuration());
}

@Test
public void testShouldReturnFalseWhenNoKerberosCredentialsOrDelegationTokens() {
UserGroupInformation.setConfiguration(getHadoopConfigWithAuthMethod(AuthenticationMethod.KERBEROS));
Expand Down

0 comments on commit c8e9d0d

Please sign in to comment.