GreeterService { public Greeting greet(String salutation, String name) { Assert.notNull(salutation, "salutation is required"); Assert.notNull(name, "name is required"); return rest.getForObject(URI_TEMPLATE, Greeting.class, salutation, name); } GreeterService(RestTemplate restTemplate); Greeting greet(String salutation, String name);  }
@Test public void greet() { given(this.rest.getForObject(" .willReturn(new Greeting("Hello Bob")); assertThat(this.greeter.greet("Hello", "Bob")) .isNotNull() .isEqualToComparingFieldByField(new Greeting("Hello Bob")); }
@Test(expected = IllegalArgumentException.class) public void greetNulls() { this.greeter.greet(null, null); }