@Test public final void shouldReturnFullName() { String firstName = "firstName"; String lastName = "lastName"; stubStringField(userEntity, UserFields.FIRST_NAME, firstName); stubStringField(userEntity, UserFields.LAST_NAME, lastName); String fullName = userService.extractFullName(userEntity); assertEquals(String.format("%s %s", firstName, lastName), fullName); }
@Override public String extractFullName(final Entity user) { if (user == null) { return null; } String firstName = user.getStringField(UserFields.FIRST_NAME); String lastName = user.getStringField(UserFields.LAST_NAME); return String.format("%s %s", firstName, lastName); }
UserServiceImpl implements UserService { @Override public String extractFullName(final Entity user) { if (user == null) { return null; } String firstName = user.getStringField(UserFields.FIRST_NAME); String lastName = user.getStringField(UserFields.LAST_NAME); return String.format("%s %s", firstName, lastName); } }
UserServiceImpl implements UserService { @Override public String extractFullName(final Entity user) { if (user == null) { return null; } String firstName = user.getStringField(UserFields.FIRST_NAME); String lastName = user.getStringField(UserFields.LAST_NAME); return String.format("%s %s", firstName, lastName); }  }
UserServiceImpl implements UserService { @Override public String extractFullName(final Entity user) { if (user == null) { return null; } String firstName = user.getStringField(UserFields.FIRST_NAME); String lastName = user.getStringField(UserFields.LAST_NAME); return String.format("%s %s", firstName, lastName); }  @Override Entity find(final Long userId); @Override Entity find(final String userName); @Override Entity getCurrentUserEntity(); @Override String extractFullName(final Entity user); }
UserServiceImpl implements UserService { @Override public String extractFullName(final Entity user) { if (user == null) { return null; } String firstName = user.getStringField(UserFields.FIRST_NAME); String lastName = user.getStringField(UserFields.LAST_NAME); return String.format("%s %s", firstName, lastName); }  @Override Entity find(final Long userId); @Override Entity find(final String userName); @Override Entity getCurrentUserEntity(); @Override String extractFullName(final Entity user);  }