users@jersey.java.net

[Jersey] Reponse.Status != response.getStatusInfo()

From: Robert DiFalco <robert.difalco_at_gmail.com>
Date: Fri, 13 Dec 2013 16:54:03 -0800

Wow, this migration to 2.4.1 from 1.9 has not been EASY!! Lots of needless
changes, horrible documentation on migration, lack of old jersey path
proxies that easy broken api fixes, etc.

Anyway,

If I have a line like this:

     rsp = target.request().post( bean );

It seems like I Response.Status.CREATED will not compare to
rsp.getStatusInfo(). Does anyone else find this to be crazy in the API
design department?

Okay, so I can fix it with this huge ass line:

      Repsonse.Status.CREATED.getStatusCode() == response.getStatus();

But come on guys, really?

    assertEquals( Respone.Status.CREATED, response.getStatusInfo() );

Won't work? This is an example of making it easier for the API implementor,
not for the API user. There are about 100 ways to have done this better.
Which one am I missing?