Does anyone tries to call o return a Diagram view? - odoo-10

I'm trying to return a Diagram view but I got an Access Error, I'm using Odoo .v10:
But my user has the proper access permission, even with the admin user I got the same access error.
This is my code:
ir.model.access.csv
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_montecarlo_project,montecarlo.project,model_montecarlo_project,group_montecarlo_user,1,1,1,1
access_montecarlo_sprint,montecarlo.sprint,model_montecarlo_sprint,group_montecarlo_user,1,1,1,1
access_montecarlo_activity,montecarlo.activity,model_montecarlo_activity,group_montecarlo_user,1,1,1,1
access_montecarlo_activity_transition,montecarlo.activity.transition,model_montecarlo_activity_transition,group_montecarlo_user,1,1,1,1
access_montecarlo_project_result,montecarlo.project.result,model_montecarlo_project_result,group_montecarlo_user,1,1,1,1
My .py code to return the the diagram view, in a button type object, and action too:
#api.multi
def show_diagram(self):
# TODO: Create a group with the permisitions to montecarlo.sprint to the user of
# that group can see the diagram view
self.ensure_one()
view_mode = 'diagram'
view_diagram_id = self.env.ref('montecarlo.montecarlo_sprint_diagram_view').id
res_id = False
domain = [('id','=',self.id)]
context = {}
return {
'name': u"Activities",
'type': 'ir.actions.act_window',
'view_mode': view_mode,
'res_model': 'montecarlo.sprint',
'target': 'self',
'views': [(view_diagram_id, 'diagram')],
'view_id': view_diagram_id,
'res_id': res_id,
'domain': domain,
'context': context,
}
And this is the console log when I press my button:
2018-01-18 02:10:10,807 14185 INFO montecarlo werkzeug: 127.0.0.1 - - [18/Jan/2018 02:10:10] "POST /web/dataset/call_button HTTP/1.1" 200 -
2018-01-18 02:10:10,850 14185 WARNING montecarlo odoo.models: montecarlo.sprint.read() with unknown field 'activity_to_id'
2018-01-18 02:10:10,852 14185 WARNING montecarlo odoo.models: montecarlo.sprint.read() with unknown field 'duration'
2018-01-18 02:10:10,852 14185 WARNING montecarlo odoo.models: montecarlo.sprint.read() with unknown field 'activity_from_id'
2018-01-18 02:10:10,854 14185 INFO montecarlo werkzeug: 127.0.0.1 - - [18/Jan/2018 02:10:10] "POST /web/dataset/call_kw/montecarlo.sprint/read HTTP/1.1" 200 -
2018-01-18 02:10:10,882 14185 INFO montecarlo werkzeug: 127.0.0.1 - - [18/Jan/2018 02:10:10] "POST /web/dataset/call_kw/montecarlo.sprint/search_read HTTP/1.1" 200 -
2018-01-18 02:10:10,920 14185 INFO montecarlo werkzeug: 127.0.0.1 - - [18/Jan/2018 02:10:10] "POST /web/dataset/search_read HTTP/1.1" 200 -
2018-01-18 02:10:10,931 14185 INFO montecarlo werkzeug: 127.0.0.1 - - [18/Jan/2018 02:10:10] "POST /web/dataset/call_kw/montecarlo.activity/read HTTP/1.1" 200 -
Let me know if you need more details of my code.
EDIT:
This is the .py models:
class Sprint(models.Model):
_name='montecarlo.sprint'
name = fields.Char('Name', required=True)
activities_ids = fields.One2many('montecarlo.activity', 'sprint_id', string='Activities')
project_id = fields.Many2one('montecarlo.project', 'Project', required=True)
class Activity(models.Model):
_name='montecarlo.activity'
name = fields.Char('Short Name')
duration = fields.Integer('Duration(weeks)',
help='Duration of the activity, on weeks.', required=True)
start = fields.Boolean('Start', help="This activity is the root of the Sprint.", index=True)
sprint_id = fields.Many2one('montecarlo.sprint', 'Sprint Name')
from_ids = fields.One2many('montecarlo.activity.transition', 'activity_to_id', string='Previous Activities')
to_ids = fields.One2many('montecarlo.activity.transition', 'activity_from_id', string='Next Activities')
class ActivityTransition(models.Model):
_name='montecarlo.activity.transition'
name = fields.Char('Description')
activity_from_id = fields.Many2one('montecarlo.activity', 'Previous Activity', required=True, ondelete="cascade")
activity_to_id = fields.Many2one('montecarlo.activity', 'Next Activity', required=True, ondelete="cascade")
And this is the Diagram view xml:
<!-- Sprint Diagram View -->
<record id="montecarlo_sprint_diagram_view" model="ir.ui.view">
<field name="name">montecarlo.sprint.diagram.view</field>
<field name="model">montecarlo.sprint</field>
<field name="arch" type="xml">
<diagram string="Project Editor">
<node object="montecarlo.activity" bgcolor="gray:start==True">
<field name="name" />
<field name="duration" />
</node>
<arrow object="montecarlo.activity.transition" source="activity_from_id" destination="activity_to_id" label="['name']">
<field name="activity_from_id" />
<field name="activity_to_id" />
</arrow>
</diagram>
</field>
</record>
Thanks.

Related

SQL Error: 900 when running update query with multiple fields

Running JPA native query with multiple fields from SQL developer console works, but the same query results in SQL Error: 900, SQLState: 42000 from JPA repository.
Query in JPA -
#Query(value = "UPDATE SUBSCRIPTIONFILE SET DESCRIPTION = ?1, FILENAME = ?2, VERSION = ?3 WHERE (PLATFORM = ?4 AND PRODUCTSKU = ?5)", nativeQuery = true)
SUBSCRIPTIONFILE updateUsingEmbdedKey(String DESCRIPTION, String FILENAME, String VERSION, String PLATFORM, String PRODUCTSKU);
And as the debug console shows -
2018-12-03 18:37:02.734 DEBUG 5180 --- [ main] org.hibernate.SQL : UPDATE SUBSCRIPTIONFILE SET DESCRIPTION = ?, FILENAME = ?, VERSION = ? WHERE (PLATFORM = ? AND PRODUCTSKU = ?)
2018-12-03 18:37:04.405 TRACE 5180 --- [ main] o.h.type.descriptor.sql.BasicBinder : binding parameter [1] as [VARCHAR] - [newDescription!]
2018-12-03 18:37:04.427 TRACE 5180 --- [ main] o.h.type.descriptor.sql.BasicBinder : binding parameter [2] as [VARCHAR] - [bla bla bla]
2018-12-03 18:37:04.437 TRACE 5180 --- [ main] o.h.type.descriptor.sql.BasicBinder : binding parameter [3] as [VARCHAR] - [bla]
2018-12-03 18:37:04.445 TRACE 5180 --- [ main] o.h.type.descriptor.sql.BasicBinder : binding parameter [4] as [VARCHAR] - [xyz]
2018-12-03 18:37:04.455 TRACE 5180 --- [ main] o.h.type.descriptor.sql.BasicBinder : binding parameter [5] as [VARCHAR] - [testSave]
My questions:
1 - is the query syntax is OK?
2- is there a better way to do it using a built-in JpaRepository query?
Entire JpaRepository -
public interface SubscriptionRepo extends JpaRepository<SUBSCRIPTIONFILE, SUBSCRIPTIONFILE_KEY>{
#Query(value = "UPDATE SUBSCRIPTIONFILE SET DESCRIPTION = ?1, FILENAME = ?2, VERSION = ?3 WHERE (PLATFORM = ?4 AND PRODUCTSKU = ?5)", nativeQuery = true)
SUBSCRIPTIONFILE updateUsingEmbdedKey(String DESCRIPTION, String FILENAME, String VERSION, String PLATFORM, String PRODUCTSKU);
}
Since this is an update you need a #Modifying annotation to go with your #Query annotation.

How to resolve HTTPS connection errors in mule?

Below is the end system(Eloqua) connection code.
<http:request config-ref="Eloqua_Bulk_API" path="/customObjects/{customObjectId}/fields" method="GET" doc:name="Eloqua Get CDO fields">
<http:request-builder>
<http:uri-param paramName="customObjectId" value="#[flowVars.cdo.id]"/>
</http:request-builder>
</http:request>
But not not getting proper repose, it is throwing below error message.
<CustomObjectFieldSearchResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="">
<ResponseStatus>
<ErrorCode>ArgumentNullException</ErrorCode>
<Message>As result 'CustomObjectFieldSearchResponse' is not a supported responseType, a defaultAction must be supplied
Parameter name: defaultAction</Message>
</ResponseStatus>
</CustomObjectFieldSearchResponse>
Message : Response code 500 mapped as failure.
Payload : org.glassfish.grizzly.utils.BufferInputStream#1f0131c5
Element : /SAPBWServiceReqInsertUpdate/input/0/0/EloquaLookupServiceRequestCDOBulk/subprocessors/1/EloquaLookupFields/subprocessors/0/0/1/2 # nol-integration-nonmaven:bulk-integration.xml:92 (Eloqua Get CDO fields)
Element XML : <http:request config-ref="Eloqua_Bulk_API" path="/customObjects/{customObjectId}/fields" method="GET" doc:name="Eloqua Get CDO fields">
<http:request-builder>
<http:uri-param paramName="customObjectId" value="#[flowVars.cdo.id]"></http:uri-param>
</http:request-builder>
</http:request>
--------------------------------------------------------------------------------
Root Exception stack trace:
org.mule.module.http.internal.request.ResponseValidatorException: Response code 500 mapped as failure.
at org.mule.module.http.internal.request.SuccessStatusCodeValidator.validate(SuccessStatusCodeValidator.java:37)
at org.mule.module.http.internal.request.DefaultHttpRequester.validateResponse(DefaultHttpRequester.java:413)
at org.mule.module.http.internal.request.DefaultHttpRequester.innerProcess(DefaultHttpRequester.java:401)
at org.mule.module.http.internal.request.DefaultHttpRequester.processBlocking(DefaultHttpRequester.java:221)
at org.mule.processor.AbstractNonBlockingMessageProcessor.process(AbstractNonBlockingMessageProcessor.java:43)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:108)
when i try from SOAPUI it is fetching the data properly.
I added added the below header in the request(http request/component). It is working fine.
name: Content-Type
value: application/json

Accessing server and mule context objects in Data weave

I'm trying to access server and mule version info in DW however I get the below message.
DWL looks like below. Please let me know if I'm making any mistakes below. I have tried both the syntaxes to access it.
%dw 1.0
%output application/json
---
{
errorType : payload.errorType,
env: server['host'],
host: server['host'],
ip: server['ip'],
javaVersion: server['javaVersion'],
javaVendor: server['javaVendor'],
osName: server['osName'],
osVersion: server['osVersion'],
muleVersion: mule.version,
clusterId: mule.clusterId,
nodeId: mule.nodeId
}
Message : Exception while executing:
env: server['host'],
^
There is no variable named 'server'.
Payload : {correlationId=046b6c7f-0b8a-43b9-b35d-6489e6daee91, message=This is the test message to test structured log, errorType=ERROR, applicationName=common wrappers - logging wrapper}
Payload Type : java.util.HashMap
Element : /wrapper-logger/processors/1 # common-wrappers:wrapper-logger.xml:16 (Transform Message)
Element XML : <dw:transform-message doc:name="Transform Message" metadata:id="38c29630-7d7c-48fc-a692-2407d0105cab">
<dw:input-payload doc:sample="sample_data\list_HashMap.dwl"></dw:input-payload>
<dw:set-payload>%dw 1.0%output application/json---{errorType : payload.errorType,env: server['host'],host: server['host'],ip: server['ip'],javaVersion: server['javaVersion'],javaVendor: server['javaVendor'],osName: server['osName'],osVersion: server['osVersion'],muleVersion: mule.version,clusterId: mule.clusterId,nodeId: mule.nodeId,applicationName : payload.applicationName,correlationId: payload.correlationId,correlationSequence: "To be decided",correlationGroupSize: 5,timeZone: server.timeZone,timeStamp: server.dateTime,muleFlow: "get-user-record",stackTrace: "A complete Stack Trace",message: payload.message}</dw:set-payload>
</dw:transform-message>
--------------------------------------------------------------------------------
Root Exception stack trace:
com.mulesoft.weave.mule.exception.WeaveExecutionException: Exception while executing:
env: server['host'],
^
There is no variable named 'server'.
at com.mulesoft.weave.mule.exception.WeaveExecutionException$.apply(WeaveExecutionException.scala:10)
You can define a Global function to get the server details and call it from dataweave.
<configuration doc:name="Configuration">
<expression-language>
<import class = "org.mule.util.NetworkUtils"/>
<import class="java.lang.System" />
<global-functions>
def getServerDetails() {
String ip = NetworkUtils.getLocalHost().getHostAddress();
String name = NetworkUtils.getLocalHost().getHostName();
String osName = System.getProperty("os.name");
String osVersion = System.getProperty("os.version");
String javaVersion = System.getProperty("java.version");
String javaVendor = System.getProperty("java.vendor");
return [ip, name, osName, osVersion, javaVersion, javaVendor];
}
</global-functions>
</expression-language>
</configuration>
Calling from dataweave
{
ip: getServerDetails()[0],
host: getServerDetails()[1],
osName: getServerDetails()[2],
osVersion: getServerDetails()[3],
javaVersion: getServerDetails()[4],
javaVendor: getServerDetails()[5]
}

How to filter JSON data from a log4j file using logstash?

I have a log file such as the following.
2014-12-24 09:41:29,383 INFO c.t.t.a.c.LoginController.getCSRFToken [http-bio-8080-exec-4] in getCSRFToken
2014-12-24 09:41:29,383 DEBUG c.t.t.a.c.LoginController.getCSRFToken [http-bio-8080-exec-4] CSRFToken set successfully.
2014-12-24 09:44:26,607 INFO c.t.t.a.c.LoginController.getCSRFToken [http-bio-8080-exec-8] in getCSRFToken
2014-12-24 09:44:26,609 DEBUG c.t.t.a.c.LoginController.getCSRFToken [http-bio-8080-exec-8] CSRFToken set successfully.
2014-12-26 09:55:28,399 INFO c.t.t.a.c.LoginController.getCSRFToken [http-bio-8080-exec-9] in getCSRFToken
2014-12-26 09:55:28,401 DEBUG c.t.t.a.c.LoginController.getCSRFToken [http-bio-8080-exec-9] CSRFToken set successfully.
2014-12-26 11:10:32,135 INFO c.t.t.a.c.LoginController.getCSRFToken [http-bio-8080-exec-10] in getCSRFToken
2014-12-26 11:10:32,136 DEBUG c.t.t.a.c.LoginController.getCSRFToken [http-bio-8080-exec-10] CSRFToken set successfully.
2014-12-26 11:12:40,500 INFO c.t.t.a.c.LoginController.getCSRFToken [http-bio-8080-exec-7] in getCSRFToken
2014-12-26 11:12:40,501 DEBUG c.t.t.a.c.LoginController.getCSRFToken [http-bio-8080-exec-7] CSRFToken set successfully.
2015-11-30 16:21:09,145 INFO c.t.t.s.a.i.AnalyticsServiceImpl.captureHit [http-bio-8080-exec-9] EnquiryDetails : {"createdTime":1448880669029,"modifiedTime":null,"active":true,"deleted":false,"deletedOn":-1,"guid":null,"uuid":null,"id":130771,"instanceId":130665,"pos":"","channel":"Web","flightNo":"TWBL2DL2","orig":"BLR","dest":"DEL","cabCls":"ECONOMY","logCls":"Y","noOfPaxs":1,"scheduleEntryId":130661,"travelDateTime":[2015,12,1,21,30],"enquiryDateTime":[2015,11,30,16,21,9,23000000]}
You will notice that the last line consists of some JSON data
I'm trying to configure my logstash to extract this JSON data
The following is my logstash config file:
input {
file {
path => "C:/Users/TESTER/Desktop/files/test1.log"
type => "test"
start_position => "beginning"
}
}
filter {
grok {
match => [ "message" , "timestamp : %{DATESTAMP:timestamp}", "severity: %{WORD:severity}", "clazz: %{JAVACLASS:clazz}", "selco: %{NOTSPACE:selco}", "testerField: (?<ENQDTLS>EnquiryDetails :)"]
}
}
output {
elasticsearch {
hosts => "localhost"
index => "test1"
}
stdout {}
}
However this is the my logstash output:
C:\logstash-2.0.0\bin>logstash -f test1.conf
io/console not supported; tty will not be manipulated
Default settings used: Filter workers: 2
Logstash startup completed
2016-01-08T08:02:02.029Z TW 2014-12-24 09:41:29,383 INFO c.t.t.a.c.LoginController.getCSRFToken [http-bio-8080-exec-4] in getCSRFToken
2016-01-08T08:02:02.029Z TW 2014-12-24 09:44:26,607 INFO c.t.t.a.c.LoginController.getCSRFToken [http-bio-8080-exec-8] in getCSRFToken
2016-01-08T08:02:02.029Z TW 2014-12-24 09:44:26,609 DEBUG c.t.t.a.c.LoginController.getCSRFToken [http-bio-8080-exec-8] CSRFToken set successfully.
2016-01-08T08:02:02.029Z TW 2014-12-26 09:55:28,399 INFO c.t.t.a.c.LoginController.getCSRFToken [http-bio-8080-exec-9] in getCSRFToken
2016-01-08T08:02:02.029Z TW 2014-12-26 09:55:28,401 DEBUG c.t.t.a.c.LoginController.getCSRFToken [http-bio-8080-exec-9] CSRFToken set successfully.
2016-01-08T08:02:02.029Z TW 2014-12-26 11:10:32,135 INFO c.t.t.a.c.LoginController.getCSRFToken [http-bio-8080-exec-10] in getCSRFToken
2016-01-08T08:02:02.029Z TW 2014-12-26 11:10:32,136 DEBUG c.t.t.a.c.LoginController.getCSRFToken [http-bio-8080-exec-10] CSRFToken set successfully.
2016-01-08T08:02:02.029Z TW 2014-12-24 09:41:29,383 DEBUG c.t.t.a.c.LoginController.getCSRFToken [http-bio-8080-exec-4] CSRFToken set successfully.
2016-01-08T08:02:02.029Z TW 2014-12-26 11:12:40,500 INFO c.t.t.a.c.LoginController.getCSRFToken [http-bio-8080-exec-7] in getCSRFToken
2016-01-08T08:02:02.029Z TW 2015-11-30 16:21:09,145 INFO c.t.t.s.a.i.AnalyticsServiceImpl.captureHit [http-bio-8080-exec-9] EnquiryDetails : {"createdTime":1448880669029,"modifiedTime":null,"active":true,"deleted":false,"deletedOn":-1,"guid":null,"uuid":null,"id":130771,"instanceId":130665,"pos":"","channel":"Web","flightNo":"TWBL2DL2","orig":"BLR","dest":"DEL","cabCls":"ECONOMY","logCls":"Y","noOfPaxs":1,"scheduleEntryId":130661,"travelDateTime":[2015,12,1,21,30],"enquiryDateTime":[2015,11,30,16,21,9,23000000]}
2016-01-08T08:02:02.029Z TW 2014-12-26 11:12:40,501 DEBUG c.t.t.a.c.LoginController.getCSRFToken [http-bio-8080-exec-7] CSRFToken set successfully.
Could someone Please tell me what i am doing wrong here. Thanks
You don't say what you're experiencing that's "wrong", but let's assuming that you're concerned about the lack of fields in your output.
First, use the rubydebug or json codec in your stdout{} output stanza. It will show you more details.
Second, it looks like your grok{} is all screwed up. grok{} takes an input field and one or more regular expressions to apply against the input. You're giving it the input ("message"), but this regexp:
"timestamp : %{DATESTAMP:timestamp}"
doesn't match your input since you have no literal string "timestamp : ".
You need something more like:
"%{DATESTAMP} %{WORD:severity}" (etc)
I would recommend setting up one grok{} stanza to pull all the common info off (everything up to the ]). Then, use another to deal with the different types of messages.
I found a solution to my problem.
input {
file {
path => "C:/Users/TESTER/Desktop/elk Files 8-1-2015/test1.log"
start_position => "beginning"
}
}
filter {
grok {
match => {"message" => "%{DATESTAMP:timestamp} %{WORD:severity} %{JAVACLASS:clazz} %{NOTSPACE:selco} (?<ENQDTLS>EnquiryDetails :) (?<JSONDATA>.*)"}
add_tag => [ "ENQDTLS"]
}
if "ENQDTLS" not in [tags] {
drop { }
}
mutate {
remove_tag => ["ENQDTLS"]
}
json {
source => "JSONDATA"
}
mutate {
remove_field => ["timestamp"]
remove_field => ["clazz"]
remove_field => ["selco"]
remove_field => ["severity"]
remove_field => ["ENQDTLS"]
remove_field => ["JSONDATA"]
}
}
output {
elasticsearch {
hosts => "localhost"
index => "test3"
}
stdout {
codec => rubydebug
}
}
So what Im doing here is filtering out any line that does not contain the keyword "EnquiryDetails" using GROK, then I am processing the JSON data in that line.
I hope this helps anyone else who might have the same issue.
Also since I'm new to this. would like to know if this is a good approach.

Spock test - RESTClient: HttpResponseException: Not Found

I want to write a test for a GET request when the API returns 404.
My test:
def "Should return 404 - object deleted before"() {
setup:
def advertisementEndpoint = new RESTClient( 'http://localhost:8080/' )
when:
def resp = advertisementEndpoint.get(
path: 'api/advertisement/1',
contentType: groovyx.net.http.ContentType.JSON
)
then:
resp.status == 404
}
My error:
14:24:59.294 [main] DEBUG o.a.h.impl.client.DefaultHttpClient -
Connection can be kept alive indefinitely 14:24:59.305 [main] DEBUG
groovyx.net.http.RESTClient - Response code: 404; found handler:
org.codehaus.groovy.runtime.MethodClosure#312aa7c 14:24:59.306 [main]
DEBUG groovyx.net.http.RESTClient - Parsing response as:
application/json 14:24:59.443 [main] DEBUG org.apache.http.wire - <<
"ba[\r][\n]" 14:24:59.444 [main] DEBUG org.apache.http.wire - <<
"{"timestamp":1436358299234,"status":404,"error":"Not
Found","exception":"com.pgssoft.exparo.web.ResourceNotFoundException","message":"No
message available","path":"/api/advertisement/1"}" 14:24:59.445 [main]
DEBUG org.apache.http.wire - << "[\r][\n]" 14:24:59.445 [main] DEBUG
org.apache.http.wire - << "0[\r][\n]" 14:24:59.446 [main] DEBUG
org.apache.http.wire - << "[\r][\n]" 14:24:59.446 [main] DEBUG
o.a.h.i.c.BasicClientConnectionManager - Releasing connection
org.apache.http.impl.conn.ManagedClientConnectionImpl#2ab4bc72
14:24:59.446 [main] DEBUG o.a.h.i.c.BasicClientConnectionManager -
Connection can be kept alive indefinitely 14:24:59.449 [main] DEBUG
groovyx.net.http.RESTClient - Parsed data to instance of: class
groovy.json.internal.LazyMap
groovyx.net.http.HttpResponseException: Not Found at
groovyx.net.http.RESTClient.defaultFailureHandler(RESTClient.java:263)
at groovy.lang.Closure.call(Closure.java:423) at
groovyx.net.http.HTTPBuilder$1.handleResponse(HTTPBuilder.java:503)
at
org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:218)
at
org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:160)
at groovyx.net.http.HTTPBuilder.doRequest(HTTPBuilder.java:515) at
groovyx.net.http.RESTClient.get(RESTClient.java:119) at
AdvertisementTest.Should return 404 - object delete
before(AdvertisementTest.groovy:79)
You need a failure handler for the underlying HTTPBuilder. From the HTTPBuilder javadoc:
You can also set a default response handler called for any status code
399 that is not matched to a specific handler. Setting the value outside a request closure means it will apply to all future requests
with this HTTPBuilder instance:
http.handler.failure = { resp ->
println "Unexpected failure: ${resp.statusLine}" }
Therefore:
#Grapes(
#Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.7.1')
)
import groovyx.net.*
import groovyx.net.http.*
def restClient = new RESTClient('http://localhost/wrong')
restClient.handler.failure = { resp -> resp.status }
def response = restClient.get([:])
assert response == 404

Resources