TouK contest – some important rules

By entering TouK contest at 33rd Degree Conference you are accepting these simple conditions:

  1. The contest is open to all 33rd Degree Conference participians, except TouK people and their family members, of course (sorry, guys).
  2. To take part, you must collect two TouK feathers (in two different colours) and hack an application. The apllication is avaliable at http://reg.touk.pl. Then you must write down the solution (with your name and surname) on a sheet of paper received at our stand. and leave it to us to enter a prize draw. You must have TouK feathers in both colors with you.
  3. Only one entry is allowed per person.
  4. The prizes are 6 Raspberry Pi computers (2 per each conference day).
  5. All entries (except the winners’) will be rolled over into subsequent draws.
  6. All prize draws take place at our stand in following dates: ·Day 1, 13 of March – 16:30 ·Day 2, 14 of March – 15:50 ·Day 3, 15 of March – 12:50
  7. Only correct and complete solutions will be awarded.
  8. The winner have to be present during the prize draw. If not, we reserve the right to award the prize to an alternative winner, drawn in accordance with these terms and conditions.
  9. If you have any questions about how to enter or in connection with the contest, please ask at TouK’s stand.
You May Also Like

Grails with Spock unit test + IntelliJ IDEA = No thread-bound request found

During my work with Grails project using Spock test in IntelliJ IDEA I've encountered this error:

java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.
at org.springframework.web.context.request.RequestContextHolder.currentRequestAttributes(RequestContextHolder.java:131)
at org.codehaus.groovy.grails.plugins.web.api.CommonWebApi.currentRequestAttributes(CommonWebApi.java:205)
at org.codehaus.groovy.grails.plugins.web.api.CommonWebApi.getParams(CommonWebApi.java:65)
... // and few more lines of stacktrace ;)

It occurred when I tried to debug one of test from IDEA level. What is interesting, this error does not happen when I'm running all test using grails test-app for instance.

So what was the issue? With little of reading and tip from Tomek Kalkosiński (http://refaktor.blogspot.com/) it turned out that our test was missing @TestFor annotation and adding it solved all problems.

This annotation, according to Grails docs (link), indicates Spock what class is being tested and implicitly creates field with given type in test class. It is somehow strange as problematic test had explicitly and "manually" created field with proper controller type. Maybe there is a problem with mocking servlet requests?