-
1. Re: HTTP GET/POST unit tests on WildFly 13.0.0.Final with JUnit 4 & 5 (Jupiter) now all return 404
notify Jul 17, 2018 1:59 PM (in response to notify)If I change my unit tests to use my local IP address in the URL it works. Why is localhost or 127.0.0.1 not working as before?
ifconfig |grep inet
inet 127.0.0.1 netmask 0xff000000
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
inet6 fe80::b0:e9a0:2b34:d0b9%en0 prefixlen 64 secured scopeid 0x7
inet 192.999.1.99 netmask 0xffffff00 broadcast 192.999.1.25
String url = "http://192.999.1.99:8080/NOTiFYwell/notifywell/product-by-ean/05052319711639";
>>>>> test03GetLastUpdated httpClient = org.apache.http.impl.client.InternalHttpClient@31dc339b
>>>>> test03GetLastUpdated response = 200
>>>>> test03GetLastUpdated response getStatus = 200
>>>>> test03GetLastUpdated response json = {
"productCharacteristics": {
"isFood": "yes",
"isDrink": "no",
"healthScore": "10",
"isHazardous": "no",
"storageType": "dry"
},
"calcNutrition": {
"per100Header": null,
"perServingHeader": null,
"calcNutrients": [
{
"name": "Energy (kJ)",
"valuePer100": "364.8",
"valuePerServing": "766.08"
},
{
"name": "Energy (kcal)",
"valuePer100": "364.80kj86.5",
"valuePerServing": "766.08kj181.65"
},
{
"name": "Fat (g)",
"valuePer100": ".5",
"valuePerServing": "1.05"
},
{
"name": "Saturates (g)",
"valuePer100": ".14",
"valuePerServing": ".29"
},
{
"name": "Carbohydrate (g)",
"valuePer100": "14.6",
"valuePerServing": "30.66"
},
{
"name": "Sugars (g)",
"valuePer100": "4.5",
"valuePerServing": "9.45"
},
{
"name": "Fibre (g)",
"valuePer100": "4.4",
"valuePerServing": "9.24"
},
{
"name": "Protein (g)",
"valuePer100": "3.7",
"valuePerServing": "7.77"
},
{
"name": "Salt (g)",
"valuePer100": ".55",
"valuePerServing": "1.15"
}
]
},
"nutrients": null,
"enumbers": null,
"chemicalsMineralsVitamins": null,
"lifestyle": {
"name": "Lifestyle",
"vaue": null
},
"id": "5b43bbd837c8a94bd4400852",
"ean": "05052319711639",
"gtin": "05052319711639",
"tpnb": "051627961",
"tpnc": "258290127",
"description": "Tesco Everyday Valuebaked Beans In Tomato Sauce 420G",
"brand": "TESCO VALUE",
"supermarket": "Tesco",
"product_name": "product_name",
"quantity_grammes": "420.0",
"portion_serving_sachet_item_amount": "",
"timestamp_lastupdated": "2018-07-09 20:47:36",
"qtyContents": [
{
"quantity": "420.0",
"totalQuantity": "420.0",
"quantityUom": "g",
"netContents": "420g e",
"avgMeasure": ""
}
],
"ingredients": [
{
"ingredientName": "Haricot Beans (44%) (Water, Haricot Beans)",
"percentage": "1"
},
{
"ingredientName": "Tomato Puree (27%) (Water, Tomato Purée)",
"percentage": "2"
},
{
"ingredientName": "Water",
"percentage": "3"
},
{
"ingredientName": "Sugar",
"percentage": "4"
},
{
"ingredientName": "Glucose-Fructose Syrup",
"percentage": "5"
},
{
"ingredientName": "Modified Maize Starch",
"percentage": "6"
},
{
"ingredientName": "Salt",
"percentage": "7"
},
{
"ingredientName": "Onion Powder",
"percentage": "8"
},
{
"ingredientName": "Paprika",
"percentage": "9"
},
{
"ingredientName": "Maltodextrin",
"percentage": "10"
},
{
"ingredientName": "Spice Extracts (Paprika Extract, Clove Extract, Capsicum Extract)",
"percentage": "11"
},
{
"ingredientName": "Flavouring",
"percentage": "12"
}
]
-
2. Re: HTTP GET/POST unit tests on WildFly 13.0.0.Final with JUnit 4 & 5 (Jupiter) now all return 404
jewellgm Jul 17, 2018 2:48 PM (in response to notify)This is just a stab in the dark, but could it have something to do with your proxy settings? Are your browser and cURL using the system proxy settings, while your java process is not? Typically local addresses bypass the proxy server, but maybe your configuration doesn't do that.
-
3. Re: HTTP GET/POST unit tests on WildFly 13.0.0.Final with JUnit 4 & 5 (Jupiter) now all return 404
notify Jul 17, 2018 3:02 PM (in response to jewellgm)The only thing that has changed since my unit tests were working using 'localhost' are:
- Upgraded from WildFly 12 -> 13
- macOS High Sierra 10.13.6 Update - Can't see anything in that.
I'll have a look at the Apple Network Settings. Any other suggestions where to look?
Thanks,