Edgar Wentzlaff created CXF-5562:
------------------------------------
Summary: value of @QueryParam/@PathParam Annotation inside
@BeanParam Classes will be ignored
Key: CXF-5562
URL: https://issues.apache.org/jira/browse/CXF-5562
Project: CXF
Issue Type: Bug
Components: JAX-RS
Affects Versions: 2.7.10
Environment: Oracle JDK 1.7.51
Reporter: Edgar Wentzlaff
Value of @QueryParam/@PathParam Annotation inside @BeanParam Classes will be
ignored by the JAXRS-Client.
TestCase:
{code:title=cxf-2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java}
//...
@Test
public void testProxyBeanParam() throws Exception {
BookStore store = JAXRSClientFactory.create("http://localhost:" + PORT,
BookStore.class);
BookStore.BookBean bean = new BookStore.BookBean();
bean.setId(100L);
bean.setId2(23L);
Book book = store.getBeanParamBook(bean);
assertEquals(123L, book.getId());
}
//...
{code}
Modified BookStore.BookBean inside Test Example
{code:title=cxf-2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java}
//...
public static class BookBean {
private long id;
private long id2;
private long id3;
public long getId() {
return id;
}
//@PathParam("id")
@PathParam("ID")
public void setId(long id) {
this.id = id;
}
public long getId2() {
return id2;
}
//@QueryParam("id2")
@QueryParam("id_2")
public void setId2(long id2) {
this.id2 = id2;
}
@Context
public void setUriInfo(UriInfo ui) {
String id3Value = ui.getQueryParameters().getFirst("id3");
if (id3Value != null) {
this.id3 = Long.valueOf(id3Value);
}
}
public long getId3() {
return id3;
}
}
//...
{code}
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)