From 3337d84ea484c26429b4c2a2505220c51fbaa685 Mon Sep 17 00:00:00 2001 From: Alexander von Renteln Date: Wed, 7 Jun 2017 10:22:03 +0200 Subject: [PATCH 1/3] update links in pom.xml --- pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 52903aa..9f691b1 100644 --- a/pom.xml +++ b/pom.xml @@ -135,14 +135,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 From aaf159d25b28aa36b86a3a049d5acf26d66c2360 Mon Sep 17 00:00:00 2001 From: Alexander von Renteln Date: Wed, 7 Jun 2017 10:23:22 +0200 Subject: [PATCH 2/3] pom.xml: move compiler versions into properties --- pom.xml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/pom.xml b/pom.xml index 9f691b1..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 - - From 91f638f0712027c31f1721e3001b7e5e449d34bd Mon Sep 17 00:00:00 2001 From: Alexander von Renteln Date: Wed, 7 Jun 2017 10:23:47 +0200 Subject: [PATCH 3/3] fix tests --- .../bitbucket/hook/MirrorRepositoryHookTest.java | 12 +++++------- .../bitbucket/hook/PasswordHandlerTest.java | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-) 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)); }