Great idea: Zlatan.fr goes to Zlatan Ibrahimovic in case…

… he accepts one of the following challenges :)

– offer me a dedicated PSG jersey, with my name on it and the following quote : ”After Zlatan, you really are the best !”

– stay at my place for a month. This way, all my life, I could say :”Ibra ? Sure, he used to sleep on my couch for a while.”

– offer me 3 lifetime season tickets, for two of my friends and I. Obviously, I”™m talking about Official tribune tickets”¦ don”™t try to fool me with your crappy H Blue tribune tickets”¦

– win penalty kicks against me, at the Parc des Princes of course, so that you”™re at home and have no excuse in case I win.

– beat me at Taekwondo. I”™ve heard you”™re not too bad at it. As I”™ve never practiced that sport myself, I recommend you to choose this challenge.

– give me one of your hair lock as a gift. Samson”™s strength came from his long hair. I think it works the same way with you. Then, I can make a key ring with it, which will bring me power for the rest of my life.

– beat me at FIFA13. You can choose the teams but, anyway trust me, there is no way you can make it.

– score a more-than-30-meter-backflip-goal in an official game. Just kidding”¦ this is not realistic.

– let me slap you in the face, without saying a word”¦ and in public obviously.

– offer a bare-chested dedicated photo of you to my girlfriend. Frankly, among all of those challenges, I have to confess it”™s not my favorite. I”™m getting fed up to see twinkles in her eyes when you take off your jersey at the end of a game.

– manage to have Neymar sign at PSG during the 2013 summer mercato.

– simply ask me to let you have this domain name for free”¦ but face to face and – as a tribute to Guillaume – in French obviously.

Here’s the full letter to Zlatan.

I think it’s a great idea :mrgreen:

Grails Unit Testing and a little fun with @Before

So, we’ve been using Grails at gibbon’s five for a while now and stumbled into different problems with our unit tests. One of the weirdest ones were occasionally failing tests on our Jenkins that never failed locally. So we digged into this a little and came up with a simple explanation, that I’d like to share with you.

Let’s assume we have a controller and want to test it. First thing you’d probably do is go to the Grails Guide, Chapter 10: Unit Testing Controllers and start with something like this:

import grails.test.mixin.TestFor

@TestFor(SimpleController)
class SimpleControllerTests {
    void testSomething() {
    }
}

Now, if you have multiple tests which need some variable set inside the (controller.)request and you have a little knowledge of JUnit, you’d probably come up with something like this:

import grails.test.mixin.TestFor
import org.junit.Before

@TestFor(SimpleController)
class SimpleControllerTests {
    @Before
    void initialize() {
        request.variable = "foobar"
    }
    void testSomething() {
        // some code here needs the request.variable
    }
    void testSomethingElse() {
        // some code here needs the request.variable
    }
}

This is bad.

Continue reading “Grails Unit Testing and a little fun with @Before” »