Grails Mocking On Steroids

by @ctoestreich

Grails Mocking
On Steroids

by @ctoestreich

Christian Oestreich

OSS org: Grails Plugin Consortium

Github: https://github.com/Grails-Plugin-Consortium


bluestem group

Company: Bluestem Group

Url: http://www.bluestembrands.com/

Back In The Day

Everything was manual

dev ops

In The Now

Everything is automated

dev ops

In The Now

automated deploy

We run a lot tests

Running a lot of the same functional tests on transactional systems cause corrupted test data

    given:
    assert customer.payments.size() == 0
­
    when:
    customer.makePayment()
­
    then:
    customer.payments.size() == 1

Mocking Is Easy, Right?!

Well Of Course!

Spock, Mockito, etc.

   //Spock
   ServiceClass serviceClass = Mock(ServiceClass)
­
   //Mockito
   List mockedList = mock(List.class);
­
   //EasyMock
   List testDouble = EasyMock.createMock(List.class);
­
   //PowerMock
   MyClass myClassMock = PowerMock.createMock(MyClass.class);

Well... unless you want to mock your external systems during integration and functional tests

whoa

"The systems behind your system don't always need to be exercised to prove your system is operating and ready for continuous deployment" -me

#microservices #boundedcontext

In our SOA we needed a way to accomplish the following

Tools we looked at

Parasoft, Betamax, SoapUI, Third-party Solutions

These didn't meet our needs, not pci compliant,
were costly or all of the above.

Service Virtualization
A Smart Proxy

Service Virtualization

stack

Service Virtualization

tracer

How about we also do these things

whoa

Why Grails?

Source Code

Demo Time

Lets Demo This

Questions?