In one of our service classes I have a bunch of methods which just return the DAO result with no processing like
public void acceptRequest(User from, User to) {
rosterDAO.acceptRequest(from, to);
}
The unit test for this method looks like this
private final RosterDAO rosterDAO = context.mock(RosterDAO.class);
...
public void testAcceptRequest() {
context.checking(new Expectations() {{
oneOf (rosterDAO).acceptRequest(from, to);
will (returnValue(1));
}
});
Now to me this test looks completely pointless, the only thing it does is test that the method calls another method. The return value is already well covered by the DAO tests.I'm tempted to drop these tests as I just don't think there's enough going on to warrant the effort to maintain them.
So for al you TDD gurus who insist on 100% coverage:
What value do you see this test bringing to the project?
How could I write it better?