From commits-return-50584-archive-asf-public=cust-asf.ponee.io@cxf.apache.org Tue Dec 4 04:30:44 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id CF04418067A for ; Tue, 4 Dec 2018 04:30:43 +0100 (CET) Received: (qmail 48046 invoked by uid 500); 4 Dec 2018 03:30:42 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 48036 invoked by uid 99); 4 Dec 2018 03:30:42 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Dec 2018 03:30:42 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 371B980612; Tue, 4 Dec 2018 03:30:42 +0000 (UTC) Date: Tue, 04 Dec 2018 03:30:42 +0000 To: "commits@cxf.apache.org" Subject: [cxf] branch master updated: Fixing and renaming CxfAutoConfigurationTest MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <154389424212.17018.17132087135742836324@gitbox.apache.org> From: reta@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: cxf X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 852b02eced57ed48e8f291ff1bae76137836047e X-Git-Newrev: ce8a7729a6db509d2bcb57d73a0a634c675b1230 X-Git-Rev: ce8a7729a6db509d2bcb57d73a0a634c675b1230 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. reta pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cxf.git The following commit(s) were added to refs/heads/master by this push: new ce8a772 Fixing and renaming CxfAutoConfigurationTest ce8a772 is described below commit ce8a7729a6db509d2bcb57d73a0a634c675b1230 Author: reta AuthorDate: Mon Dec 3 22:30:22 2018 -0500 Fixing and renaming CxfAutoConfigurationTest --- ...tionTests.java => CxfAutoConfigurationTest.java} | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/integration/spring-boot/autoconfigure/src/test/java/org/apache/cxf/spring/boot/autoconfigure/CxfAutoConfigurationTests.java b/integration/spring-boot/autoconfigure/src/test/java/org/apache/cxf/spring/boot/autoconfigure/CxfAutoConfigurationTest.java similarity index 84% rename from integration/spring-boot/autoconfigure/src/test/java/org/apache/cxf/spring/boot/autoconfigure/CxfAutoConfigurationTests.java rename to integration/spring-boot/autoconfigure/src/test/java/org/apache/cxf/spring/boot/autoconfigure/CxfAutoConfigurationTest.java index 3c34b2a..77e2605 100644 --- a/integration/spring-boot/autoconfigure/src/test/java/org/apache/cxf/spring/boot/autoconfigure/CxfAutoConfigurationTests.java +++ b/integration/spring-boot/autoconfigure/src/test/java/org/apache/cxf/spring/boot/autoconfigure/CxfAutoConfigurationTest.java @@ -24,7 +24,10 @@ import org.apache.cxf.endpoint.Server; import org.apache.cxf.endpoint.ServerImpl; import org.apache.cxf.spring.boot.jaxrs.CustomJaxRSServer; import org.hamcrest.Matcher; -import org.springframework.beans.factory.BeanCreationException; +import org.springframework.beans.factory.UnsatisfiedDependencyException; +import org.springframework.boot.context.properties.ConfigurationPropertiesBindException; +import org.springframework.boot.context.properties.bind.BindException; +import org.springframework.boot.context.properties.bind.validation.BindValidationException; import org.springframework.boot.test.util.TestPropertyValues; import org.springframework.boot.web.servlet.ServletRegistrationBean; import org.springframework.mock.web.MockServletContext; @@ -36,9 +39,13 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; +import static org.hamcrest.Matchers.allOf; +import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasEntry; import static org.hamcrest.Matchers.hasItem; +import static org.hamcrest.Matchers.hasProperty; +import static org.hamcrest.Matchers.instanceOf; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; @@ -48,7 +55,7 @@ import static org.junit.Assert.assertTrue; * * @author Vedran Pavic */ -public class CxfAutoConfigurationTests { +public class CxfAutoConfigurationTest { @Rule public ExpectedException thrown = ExpectedException.none(); @@ -71,8 +78,12 @@ public class CxfAutoConfigurationTests { @Test public void customPathMustBeginWithASlash() { - this.thrown.expect(BeanCreationException.class); - this.thrown.expectMessage("Path must start with /"); + this.thrown.expect(UnsatisfiedDependencyException.class); + this.thrown.expectCause( + allOf(instanceOf(ConfigurationPropertiesBindException.class), hasProperty("cause", + allOf(instanceOf(BindException.class), hasProperty("cause", + allOf(instanceOf(BindValidationException.class), + hasProperty("message", containsString("Path must start with /")))))))); load(CxfAutoConfiguration.class, "cxf.path=invalid"); } @@ -106,7 +117,7 @@ public class CxfAutoConfigurationTests { @Test public void customInitParameters() { load(CxfAutoConfiguration.class, "cxf.servlet.init.key1=value1", - "spring.cxf.servlet.init.key2=value2"); + "cxf.servlet.init.key2=value2"); ServletRegistrationBean registrationBean = this.context .getBean(ServletRegistrationBean.class); Matcher> v1 = hasEntry("key1", "value1");