From 1b7b1c5214d21a5f91324add8afc6eea9d4e6d71 Mon Sep 17 00:00:00 2001 From: Sven Merk Date: Mon, 1 Apr 2019 09:01:31 +0200 Subject: [PATCH] Refactor test to address review comments --- .../integration/WhitesourceRepositoryTest.groovy | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/test/groovy/com/sap/piper/integration/WhitesourceRepositoryTest.groovy b/test/groovy/com/sap/piper/integration/WhitesourceRepositoryTest.groovy index 29b380503..270cff08b 100644 --- a/test/groovy/com/sap/piper/integration/WhitesourceRepositoryTest.groovy +++ b/test/groovy/com/sap/piper/integration/WhitesourceRepositoryTest.groovy @@ -51,15 +51,9 @@ class WhitesourceRepositoryTest extends BasePiperTest { @Test void testMissingConfig() { - def errorCaught = false - try { - new WhitesourceRepository(nullScript, [:]) - } catch (e) { - errorCaught = true - assertThat(e, isA(AbortException.class)) - assertThat(e.getMessage(), is("Parameter 'whitesource.serviceUrl' must be provided as part of the configuration.")) - } - assertThat(errorCaught, is(true)) + exception.expect(AbortException) + exception.expectMessage("Parameter 'whitesource.serviceUrl' must be provided as part of the configuration.") + new WhitesourceRepository(nullScript, [:]) } @Test