diff --git a/pom.xml b/pom.xml index 52903aa..5f7aab9 100644 --- a/pom.xml +++ b/pom.xml @@ -28,11 +28,13 @@ UTF-8 + 1.8 + 1.8 + 4.0.1 ${bitbucket.version} 3.0.5 - 6.1.0 - + 6.3.0 @@ -101,14 +103,6 @@ - - maven-compiler-plugin - 3.2 - - 1.8 - 1.8 - - @@ -135,14 +129,14 @@ - scm:git:ssh://git@github.com:englishtown/stash-hook-mirror.git - scm:git:ssh://git@github.com:englishtown/stash-hook-mirror.git - scm:git:https://github.com/englishtown/stash-hook-mirror + scm:git:ssh://git@github.com:ef-labs/stash-hook-mirror.git + scm:git:ssh://git@github.com:ef-labs/stash-hook-mirror.git + scm:git:https://github.com/ef-labs/stash-hook-mirror Github Issues - https://github.com/englishtown/stash-hook-mirror/issues + https://github.com/ef-labs/stash-hook-mirror/issues diff --git a/src/test/java/com/englishtown/bitbucket/hook/MirrorRepositoryHookTest.java b/src/test/java/com/englishtown/bitbucket/hook/MirrorRepositoryHookTest.java index 9113283..1c8dda7 100644 --- a/src/test/java/com/englishtown/bitbucket/hook/MirrorRepositoryHookTest.java +++ b/src/test/java/com/englishtown/bitbucket/hook/MirrorRepositoryHookTest.java @@ -91,7 +91,6 @@ public class MirrorRepositoryHookTest { when(passwordEncryptor.decrypt(anyString())).thenReturn(password); Repository repo = mock(Repository.class); - when(repo.getName()).thenReturn("test"); hook.postReceive(buildContext(repo), new ArrayList<>()); verifyExecutor(); @@ -123,19 +122,19 @@ public class MirrorRepositoryHookTest { Runnable runnable = argumentCaptor.getValue(); runnable.run(); - verify(executor, times(1)).schedule(argumentCaptor.capture(), anyInt(), any(TimeUnit.class)); + verify(executor, times(1)).schedule(argumentCaptor.capture(), anyLong(), any(TimeUnit.class)); runnable = argumentCaptor.getValue(); runnable.run(); - verify(executor, times(2)).schedule(argumentCaptor.capture(), anyInt(), any(TimeUnit.class)); + verify(executor, times(2)).schedule(argumentCaptor.capture(), anyLong(), any(TimeUnit.class)); runnable = argumentCaptor.getValue(); runnable.run(); - verify(executor, times(3)).schedule(argumentCaptor.capture(), anyInt(), any(TimeUnit.class)); + verify(executor, times(3)).schedule(argumentCaptor.capture(), anyLong(), any(TimeUnit.class)); runnable = argumentCaptor.getValue(); runnable.run(); - verify(executor, times(4)).schedule(argumentCaptor.capture(), anyInt(), any(TimeUnit.class)); + verify(executor, times(4)).schedule(argumentCaptor.capture(), anyLong(), any(TimeUnit.class)); runnable = argumentCaptor.getValue(); runnable.run(); @@ -143,7 +142,7 @@ public class MirrorRepositoryHookTest { runnable.run(); runnable.run(); runnable.run(); - verify(executor, times(4)).schedule(argumentCaptor.capture(), anyInt(), any(TimeUnit.class)); + verify(executor, times(4)).schedule(argumentCaptor.capture(), anyLong(), any(TimeUnit.class)); } @@ -249,7 +248,6 @@ public class MirrorRepositoryHookTest { verify(errors, never()).addFormError(anyString()); verify(errors, never()).addFieldError(anyString(), anyString()); - when(passwordEncryptor.isEncrypted(anyString())).thenReturn(true); errors = mock(SettingsValidationErrors.class); hook.validate(settings, errors, repo); verify(errors, never()).addFormError(anyString()); diff --git a/src/test/java/com/englishtown/bitbucket/hook/PasswordHandlerTest.java b/src/test/java/com/englishtown/bitbucket/hook/PasswordHandlerTest.java index 260ff79..46449f5 100644 --- a/src/test/java/com/englishtown/bitbucket/hook/PasswordHandlerTest.java +++ b/src/test/java/com/englishtown/bitbucket/hook/PasswordHandlerTest.java @@ -44,7 +44,7 @@ public class PasswordHandlerTest { @Test public void testOnCancel() throws Exception { - handler.onCancel(secretText, 0, secretText, null); + handler.onCancel(secretText, 0, secretText, new RuntimeException()); verify(exitHandler).onCancel(eq(cleanedText), eq(0), eq(cleanedText), any(Throwable.class)); } @@ -52,7 +52,7 @@ public class PasswordHandlerTest { @Test public void testOnExit() throws Exception { - handler.onExit(secretText, 0, secretText, null); + handler.onExit(secretText, 0, secretText, new RuntimeException()); verify(exitHandler).onExit(eq(cleanedText), eq(0), eq(cleanedText), any(Throwable.class)); }