Skip to content

Commit

Permalink
[JENKINS-50296] Added test case
Browse files Browse the repository at this point in the history
  • Loading branch information
agentgonzo committed Mar 21, 2018
1 parent f3053ef commit 44e1541
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions core/src/test/java/hudson/model/ComputerTest.java
@@ -1,9 +1,18 @@
package hudson.model;

import hudson.FilePath;
import hudson.security.ACL;
import jenkins.model.Jenkins;
import org.acegisecurity.Authentication;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;

import java.io.File;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;

/**
* @author Kohsuke Kawaguchi
Expand All @@ -28,4 +37,11 @@ public void testRelocate() throws Exception {
dir.deleteRecursive();
}
}

@Issue("JENKINS-42556")
@Test
public void testThreadPoolForRemotingActsAsSystemUser() throws InterruptedException, ExecutionException {
Future<Authentication> job = Computer.threadPoolForRemoting.submit(Jenkins::getAuthentication);
assertThat(job.get(), is(ACL.SYSTEM));
}
}

0 comments on commit 44e1541

Please sign in to comment.