GetCodeOwnerStatusIT: Make use of the setAsCodeOwners method
Simplifies the tests and removes duplicate code.
Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: I261a883a7a67e337314c95837cbfd840cab57dec
diff --git a/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/GetCodeOwnerStatusIT.java b/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/GetCodeOwnerStatusIT.java
index 531f118..01d3687 100644
--- a/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/GetCodeOwnerStatusIT.java
+++ b/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/GetCodeOwnerStatusIT.java
@@ -42,13 +42,7 @@
public void getStatus() throws Exception {
TestAccount user2 = accountCreator.user2();
- codeOwnerConfigOperations
- .newCodeOwnerConfig()
- .project(project)
- .branch("master")
- .folderPath("/foo/")
- .addCodeOwnerEmail(user.email())
- .create();
+ setAsCodeOwners("/foo/", user);
String path = "foo/bar.baz";
PushOneCommit.Result r = createChange("Change Adding A File", path, "file content");
@@ -81,20 +75,8 @@
public void getStatusForRenamedFile() throws Exception {
TestAccount user2 = accountCreator.user2();
- codeOwnerConfigOperations
- .newCodeOwnerConfig()
- .project(project)
- .branch("master")
- .folderPath("/foo/bar")
- .addCodeOwnerEmail(user.email())
- .create();
- codeOwnerConfigOperations
- .newCodeOwnerConfig()
- .project(project)
- .branch("master")
- .folderPath("/foo/baz")
- .addCodeOwnerEmail(user2.email())
- .create();
+ setAsCodeOwners("/foo/bar/", user);
+ setAsCodeOwners("/foo/baz/", user2);
String oldPath = "foo/bar/abc.txt";
String newPath = "foo/baz/abc.txt";