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, and you'll learn that it's possible to write the whole stack using Groovy. Isn't that amazing?
46. Tests
▷ Spock Framework
▷ 0.7 for more than 4 years
▷ Now 1.0 (more than 1.5 years now)
▷ JUnit compatible (but way better)
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', "")
}
}