Tag Archives: testing

Tired of slow functional tests?

If you are a good QA or just a good agile developer I’m sure you’re already testing your web applications with tools such as Selenium.(*) 
If you’re seeking for continuous improvement I’m sure that you complained at least once on the speed of those testing and on the maintainability. 
You might wanna then have a look on the [...]

Posted in General Stuff | Also tagged , , , , , | 1 Comment

HelloWorld v 2.0

Once upon a time we used to write:

public static void main(String[] args) {
System.out.println(”Hello World”);
}

Now I prefer:

@Test
public void shouldSayHelloToTheGivenName() throws Exception {
// given
PrintStream mockStream = mock(PrintStream.class);
Greeter greeter = new Greeter(mockStream);

// when
greeter.helloworld(”toni”);

// then
verify(mockStream).println(”Hello world, toni”);
}

The test is of course using the beautiful test double framework Mockito

Posted in General Stuff | Also tagged , , | 3 Comments