Skip to content

Commit

Permalink
refactor(NaginatorActionFactoryTest): Migrate from deprecated Authori…
Browse files Browse the repository at this point in the history
…zationMatrixProperty constructor
  • Loading branch information
sghill committed Jul 3, 2024
1 parent def61da commit 33fef68
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import org.htmlunit.ElementNotFoundException;
import org.htmlunit.html.HtmlAnchor;
import org.jenkinsci.plugins.matrixauth.PermissionEntry;
import org.jenkinsci.plugins.matrixauth.inheritance.InheritParentStrategy;
import org.junit.After;
import org.junit.ClassRule;
import org.junit.Test;
Expand Down Expand Up @@ -179,10 +180,10 @@ public void testRetryLinkForPermittedUserByProject() throws Exception {

FreeStyleProject p = r.createFreeStyleProject();

Map<Permission, Set<String>> authMap = new HashMap<Permission, Set<String>>();
authMap.put(Item.READ, Sets.newHashSet("user1"));
authMap.put(Item.BUILD, Sets.newHashSet("user1"));
p.addProperty(new AuthorizationMatrixProperty(authMap));
Map<Permission, Set<PermissionEntry>> authMap = new HashMap<>();
authMap.put(Item.READ, Sets.newHashSet(new PermissionEntry(EITHER, "user1")));
authMap.put(Item.BUILD, Sets.newHashSet(new PermissionEntry(EITHER, "user1")));
p.addProperty(new AuthorizationMatrixProperty(authMap, new InheritParentStrategy()));

p.getBuildersList().add(new FailureBuilder());
FreeStyleBuild b = r.assertBuildStatus(Result.FAILURE, p.scheduleBuild2(0).get());
Expand Down

0 comments on commit 33fef68

Please sign in to comment.