cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6901] Fixing an issue with resolving the query templates
Date Mon, 16 May 2016 12:05:38 GMT
Repository: cxf
Updated Branches:
  refs/heads/master a732913f6 -> 42c4f5a8d


[CXF-6901] Fixing an issue with resolving the query templates


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/42c4f5a8
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/42c4f5a8
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/42c4f5a8

Branch: refs/heads/master
Commit: 42c4f5a8d84decaefc705c964bf85e232e62e932
Parents: a732913
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Mon May 16 13:05:19 2016 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Mon May 16 13:05:19 2016 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java   | 2 +-
 .../java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java    | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/42c4f5a8/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
index 261351b..e9084ad 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
@@ -291,7 +291,7 @@ public class UriBuilderImpl extends UriBuilder implements Cloneable {
             ? Collections.<String>emptySet() : new HashSet<String>();
         for (String var : uniqueVars) {
             
-            boolean resolvedPathVarHasToBeEncoded = !isQuery && alreadyResolvedTsPathEnc.containsKey(var);
+            boolean resolvedPathVarHasToBeEncoded = alreadyResolvedTsPathEnc.containsKey(var);
             boolean varValueHasToBeEncoded = resolvedPathVarHasToBeEncoded || alreadyResolvedTs.containsKey(var);
             
             Map<String, Object> resolved = !varValueHasToBeEncoded ? alreadyResolvedTsEnc


http://git-wip-us.apache.org/repos/asf/cxf/blob/42c4f5a8/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
index 2bf7829..f574701 100644
--- a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
+++ b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
@@ -265,6 +265,13 @@ public class UriBuilderImplTest extends Assert {
             .build("valueA", "valueB");
         assertEquals("/index.jsp?a=valueA&b=valueB", uri.toString());        
     }
+    
+    @Test
+    public void testResolveTemplateInQuery() {
+        String uri = UriBuilder.fromPath("my/path").queryParam("qp",
+            "{param}").resolveTemplate("param", "value").toTemplate();
+        assertEquals("my/path?qp=value", uri.toString());        
+    }
 
     @Test(expected = IllegalArgumentException.class)
     public void testQueryParamWithMissingTemplateValues() {


Mime
View raw message