How many times have you ever heard the term “Full-Stack developer”? In most of the cases it means that you have to be fluent with a backend language, html, javascript, maybe Android or iOS… What if I told you that you can be a Full-Stack developer using only Groovy?In this talk I’ll present the technological stack of Polaromatic, the application with I won the Learning Spring Boot contest, and you’ll learn that it’s possible to write the whole stack with Groovy: Backend, Javascript, HTML, Android, test, build tool,… Isn’t that amazing?
47. Spock
class BrowserPushServiceSpec extends Specification {
void 'should push a converted photo to the browser'() {
given: 'a photo'
def output = File.createTempFile("output", "")
def photo = new Photo(output: output.path)
and: 'a mocked SimpMessagingTemplate'
def mockSimpMessagingTemplate = Mock(SimpMessagingTemplate)
and: 'the push service'
def browserPushService = new BrowserPushService(template: mockSimpMessagingTemplate)
when: 'pushing the photo to the browser'
browserPushService.pushToBrowser(photo)
then: 'the photo is pushed'
1 * mockSimpMessagingTemplate.convertAndSend('/notifications/photo', "")
}
}