[
https://issues.apache.org/jira/browse/BROOKLYN-83?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14207932#comment-14207932
]
Aled Sage commented on BROOKLYN-83:
-----------------------------------
According to https://docs.oracle.com/cd/E19776-01/820-4867/ghrpv/, the rules
for which method is the default (i.e. if no "Accepts" is supplied) is:
... If both are equally acceptable, then the former will be chosen because
it occurs first.
If I rename the `SensorApi.get()` method to `SensorApi.getZ()` then the tests
fail in the same way as reported in this bug.
Depending how resteasy is determining the method order, this could be entirely
random based on the compiler used. For example, `class.getMethods()` gives no
guarantee about the returned order.
I think we should delete the methods that are testing defaults, and just have
the methods that explicitly say whether they want plain or json back.
> HTTP tests under NetBeans fail -- defaulting to Accepts text/plain?
> -------------------------------------------------------------------
>
> Key: BROOKLYN-83
> URL: https://issues.apache.org/jira/browse/BROOKLYN-83
> Project: Brooklyn
> Issue Type: Bug
> Environment: netbeans
> Reporter: David Medinets
> Priority: Minor
>
> I cloned the github repository this evening. Then ran a build using NetBeans.
> I ran into the following test failure:
> testGet(brooklyn.rest.resources.SensorResourceTest) Time elapsed: 0.004 sec
> <<< FAILURE!
> java.lang.AssertionError: expected ["12345 frogs"] but found [12345 frogs]
> at org.testng.Assert.fail(Assert.java:94)
> at org.testng.Assert.failNotEquals(Assert.java:494)
> at org.testng.Assert.assertEquals(Assert.java:123)
> at org.testng.Assert.assertEquals(Assert.java:165)
> at
> brooklyn.rest.resources.SensorResourceTest.doSensorTestUntyped(SensorResourceTest.java:161)
> at
> brooklyn.rest.resources.SensorResourceTest.doSensorTest(SensorResourceTest.java:143)
> at
> brooklyn.rest.resources.SensorResourceTest.testGet(SensorResourceTest.java:170)
> I marked this critical because the build failed.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)