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