users@jersey.java.net

Re: [Jersey] Test-Framework: 201: How to get the Location

From: Paul Sandoz <Paul.Sandoz_at_oracle.com>
Date: Mon, 30 Aug 2010 14:33:57 +0200

On Aug 30, 2010, at 12:57 PM, Johannes Schneider wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Okay, found it out:
>
> ClientResponse clientResponse = resource().path( "users" ).accept(
> MediaType.APPLICATION_XML ).post( ClientResponse.class, newUser );
>
>
> Hard to find...
> Maybe it is a good idea to add some convenience method therefore....
>

Yeah, i am not sure what i was thinking when i defined the methods
put(), post(), delete() on WebResource that return void. However, i
cannot change the current methods because it will break compatibility.

So it means adding more methods, and there are already quite a lot :-(

Any suggestions for an appropriate naming scheme?

Paul.

>
> Thanks,
>
> Johannes Schneider
>
>
> On 08/30/2010 12:49 PM, Johannes Schneider wrote:
>> Hi guys,
>>
>> I am using the testing framework and extending JerseyTest.
>>
>> Now I create a POST like that:
>>
>> resource().path( "users" ).accept( MediaType.APPLICATION_XML ).post(
>> String.class, newUser );
>>
>> That works as expected.
>>
>> My resource returns 201 and the location of the newly created user.
>> Now
>> I'd like to test this link within my tests.
>> But I don't find a way to get the header information. Any hints how
>> to
>> solve that?
>>
>>
>> Thanks,
>>
>> Johannes
>
> -
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>
> - --
> Johannes Schneider - blog.cedarsoft.com
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
>
> iQEcBAEBAgAGBQJMe46LAAoJEAytD9R7Qv6dwJcIAIuvZP23prcpRTLMr3ocFl8W
> W9Ju8DqvfvqCQQbapyrUptUIpctjce4BSzkdwdoImrM/Izg5kVyPdUTocK66Try+
> 1dP/5ZKys5LCKwKmTFl9N7caYE7aYf8HamFl5pdLcnxoddyqRwH8xQXZKqUc90vJ
> YN3lAhwLF67uzRkcfp9mYobaEFGVPeEGUg6BDQ/9Stfrjs6fsvlIW1UV95jEeIxf
> N7zvCpSQt7yMHNLiiuVIk7uS96uvsK3DcWmNXRl1OnH9CCtMsGQR4djjfEFXNXDk
> b9ZnYcbArI09tgTnYVvDmiVEgohF1x0Yz6zrl4OBf+HT5obG/PD8rQ+dNSs6Uko=
> =0Jh4
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>