Other examples can be found in the integration tests for the OpenFIGI Client.
Ignoring the imports in this example we only need three lines of code to be in a position to execute a call to the OpenFIGI web services:
#24: Configures the Spring application context which we use to acquire instances of the OpenFIGI QueryBuilder.
def applicationContext = new AnnotationConfigApplicationContext (“com.coherentlogic.coherent.data.adapter.openfigi.client.core.configuration”)
#26: A reference to the QueryBuilder is acquired.
def queryBuilder = applicationContext.getBean(QueryBuilder.class)
#28: The query is constructed and executed.
def data = queryBuilder
Below is an example of this script being executed in the GroovyConsole with some sample output below.