@@ -831,7 +831,6 @@ public void testOnePullRequestForMultipleDockerfilesInSameRepo() throws Exceptio
831831 when (parentRepo .getFullName ()).thenReturn ("repo1" );
832832 when (forkedRepo .getParent ()).thenReturn (parentRepo );
833833
834- //GHRepository parent = mock(GHRepository.class);
835834 String defaultBranch = "default" ;
836835 when (parentRepo .getDefaultBranch ()).thenReturn (defaultBranch );
837836 GHBranch parentBranch = mock (GHBranch .class );
@@ -854,13 +853,13 @@ public void testOnePullRequestForMultipleDockerfilesInSameRepo() throws Exceptio
854853 eq ("df12" ), eq ("image-tag" ))).thenReturn (forkedRepoContent2 );
855854
856855 //Both Dockerfiles modified
857- doReturn (true ).when (dockerfileGitHubUtil ).modifyOnGithub (eq (forkedRepoContent1 ),
856+ doReturn (true ).when (dockerfileGitHubUtil ).modifyContentOnGithub (eq (forkedRepoContent1 ),
858857 eq ("image-tag" ),
859858 eq ("image" ),
860859 eq ("tag" ),
861860 eq (null ),
862861 eq (null ));
863- doReturn (true ).when (dockerfileGitHubUtil ).modifyOnGithub (eq (forkedRepoContent2 ),
862+ doReturn (true ).when (dockerfileGitHubUtil ).modifyContentOnGithub (eq (forkedRepoContent2 ),
864863 eq ("image-tag" ),
865864 eq ("image" ),
866865 eq ("tag" ),
@@ -881,7 +880,7 @@ public void testOnePullRequestForMultipleDockerfilesInSameRepo() throws Exceptio
881880
882881 // Both Dockerfiles modified
883882 verify (dockerfileGitHubUtil , times (2 ))
884- .modifyOnGithub (any (), eq ("image-tag" ), eq ("image" ), eq ("tag" ), any (), any ());
883+ .modifyContentOnGithub (any (), eq ("image-tag" ), eq ("image" ), eq ("tag" ), any (), any ());
885884
886885 // Only one PR created on the repo with changes to both Dockerfiles.
887886 verify (dockerfileGitHubUtil ).createPullReq (eq (parentRepo ),
@@ -907,7 +906,6 @@ public void testPullRequestBlockNotExecutedWhenDockerfileIsNotModified() throws
907906 when (parentRepo .getFullName ()).thenReturn ("repo" );
908907 when (forkedRepo .getParent ()).thenReturn (parentRepo );
909908
910- //GHRepository parent = mock(GHRepository.class);
911909 String defaultBranch = "default" ;
912910 when (parentRepo .getDefaultBranch ()).thenReturn (defaultBranch );
913911 GHBranch parentBranch = mock (GHBranch .class );
@@ -926,7 +924,7 @@ public void testPullRequestBlockNotExecutedWhenDockerfileIsNotModified() throws
926924 eq ("df11" ), eq ("image-tag" ))).thenReturn (forkedRepoContent );
927925
928926 //Dockerfile not modified
929- doReturn (false ).when (dockerfileGitHubUtil ).modifyOnGithub (eq (forkedRepoContent ),
927+ doReturn (false ).when (dockerfileGitHubUtil ).modifyContentOnGithub (eq (forkedRepoContent ),
930928 eq ("image-tag" ),
931929 eq ("image" ),
932930 eq ("tag" ),
@@ -944,10 +942,10 @@ public void testPullRequestBlockNotExecutedWhenDockerfileIsNotModified() throws
944942 eq ("df11" ), eq ("image-tag" ));
945943
946944 // Trying to modify Dockerfile
947- verify (dockerfileGitHubUtil ).modifyOnGithub (any (), eq ("image-tag" ), eq ("image" ), eq ("tag" ), any (), any ());
945+ verify (dockerfileGitHubUtil ).modifyContentOnGithub (any (), eq ("image-tag" ), eq ("image" ), eq ("tag" ), any (), any ());
948946
949947 // PR creation block not executed
950- verify (dockerfileGitHubUtil , times ( 0 )).createPullReq (eq (parentRepo ),
948+ verify (dockerfileGitHubUtil , never ( )).createPullReq (eq (parentRepo ),
951949 eq ("image-tag" ), eq (forkedRepo ), any (), eq (rateLimiter ));
952950 }
953951
@@ -971,7 +969,6 @@ public void testPullRequestCreatedWhenAnyDockerfileIsModified() throws Exception
971969 when (parentRepo .getFullName ()).thenReturn ("repo" );
972970 when (forkedRepo .getParent ()).thenReturn (parentRepo );
973971
974- //GHRepository parent = mock(GHRepository.class);
975972 String defaultBranch = "default" ;
976973 when (parentRepo .getDefaultBranch ()).thenReturn (defaultBranch );
977974 GHBranch parentBranch = mock (GHBranch .class );
@@ -994,15 +991,15 @@ public void testPullRequestCreatedWhenAnyDockerfileIsModified() throws Exception
994991 eq ("df12" ), eq ("image-tag" ))).thenReturn (forkedRepoContent2 );
995992
996993 //First dockerfile not modified
997- doReturn (false ).when (dockerfileGitHubUtil ).modifyOnGithub (eq (forkedRepoContent ),
994+ doReturn (false ).when (dockerfileGitHubUtil ).modifyContentOnGithub (eq (forkedRepoContent ),
998995 eq ("image-tag" ),
999996 eq ("image" ),
1000997 eq ("tag" ),
1001998 eq (null ),
1002999 eq (null ));
10031000
10041001 //Second dockerfile modified
1005- doReturn (true ).when (dockerfileGitHubUtil ).modifyOnGithub (eq (forkedRepoContent2 ),
1002+ doReturn (true ).when (dockerfileGitHubUtil ).modifyContentOnGithub (eq (forkedRepoContent2 ),
10061003 eq ("image-tag" ),
10071004 eq ("image" ),
10081005 eq ("tag" ),
@@ -1022,7 +1019,7 @@ public void testPullRequestCreatedWhenAnyDockerfileIsModified() throws Exception
10221019 eq ("df12" ), eq ("image-tag" ));
10231020
10241021 // Trying to modify both Dockerfiles
1025- verify (dockerfileGitHubUtil , times (2 )).modifyOnGithub (any (), eq ("image-tag" ), eq ("image" )
1022+ verify (dockerfileGitHubUtil , times (2 )).modifyContentOnGithub (any (), eq ("image-tag" ), eq ("image" )
10261023 , eq ("tag" ), any (), any ());
10271024
10281025 // PR created
0 commit comments