Skip to content

Commit 5be761a

Browse files
author
eugenp
committed
initial work on fixing the resttemplate uri problem
1 parent 75b9a63 commit 5be761a

4 files changed

Lines changed: 6 additions & 25 deletions

File tree

‎common/src/main/java/org/rest/common/client/template/AbstractClientRestTemplate.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import org.springframework.http.ResponseEntity;
2121
import org.springframework.web.client.HttpClientErrorException;
2222
import org.springframework.web.client.RestTemplate;
23+
import org.springframework.web.util.UriTemplate;
2324

2425
import com.google.common.base.Preconditions;
2526
import com.google.common.collect.Lists;
@@ -239,7 +240,8 @@ public final List<T> searchAll(final Triple<String, ClientOperation, String>...
239240
for (final Triple<String, ClientOperation, String> constraint : constraints) {
240241
builder.consume(constraint);
241242
}
242-
final String queryURI = getUri() + QueryConstants.QUERY_PREFIX + builder.build();
243+
244+
final String queryURI = new UriTemplate(getUri() + QueryConstants.QUERY_PREFIX + "{qu}").expand(builder.build()).toASCIIString();
243245

244246
final ResponseEntity<List> asResponse = findAllAsResponse(queryURI);
245247
Preconditions.checkState(asResponse.getStatusCode().value() == 200);

‎sec/eclipse/INTEGRATION-COMMON-SINGLE.launch‎

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
22
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
33
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
4-
<listEntry value="/rest-sec/src/test/java/org/rest/sec/web/user/UserDiscoverabilityRestIntegrationTest.java"/>
4+
<listEntry value="/rest-sec/src/test/java/org/rest/sec/client/template/test/PrivilegeLogicClientRestIntegrationTest.java"/>
55
</listAttribute>
66
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
77
<listEntry value="1"/>
@@ -11,10 +11,10 @@
1111
</mapAttribute>
1212
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
1313
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
14-
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
14+
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value="givenResourceExists_whenResourceIsSearchedByNameAttribute_thenNoExceptions"/>
1515
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
1616
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
17-
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.rest.sec.web.user.UserDiscoverabilityRestIntegrationTest"/>
17+
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.rest.sec.client.template.test.PrivilegeLogicClientRestIntegrationTest"/>
1818
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="rest-sec"/>
1919
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
2020
</launchConfiguration>

‎test/src/main/java/org/rest/common/client/AbstractLogicClientRestIntegrationTest.java‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ public final void givenResourceExists_whenResourceIsRetrieved_thenResourceIsCorr
186186
// search one - by attributes
187187

188188
@Test
189-
@Ignore("bug in RestTemplate")
190189
public final void givenResourceExists_whenResourceIsSearchedByNameAttribute_thenNoExceptions() {
191190
// Given
192191
final T existingResource = getApi().create(createNewEntity());

0 commit comments

Comments
 (0)