Created
July 11, 2014 08:20
-
-
Save gbougeard/e725df015c8cdb04ca9d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UserMock { | |
/** | |
* Create instance {@Link User} | |
* | |
* @param custid | |
* @param hotelid | |
* @since 1.0 | |
*/ | |
public final static User createUser(Integer custid, | |
Integer hotelid) { | |
User user = new User(); | |
user.setCustid(custid); | |
user.setHotelid(hotelid); | |
return user; | |
} | |
/** | |
* @param user {@Link User} | |
* @param type | |
* @link Constants#CUSTOMER_LOGINTYPE} @see {@link Constants#HOTELIER_LOGINTYPE} | |
* @return {@Link User} | |
* @since 1.0 | |
*/ | |
private final static User setType(User user, | |
String type) { | |
user = Preconditions.checkNotNull(user, "user is null"); | |
user.setType(type); | |
return user; | |
} | |
/** | |
* @link Constants#CUSTOMER_LOGINTYPE} | |
* @param user | |
* {@Link User} | |
* @return {@Link User} | |
* @since 1.0 | |
*/ | |
public final static void setTypeCustomer(User user) { | |
UserMock.setType(user, Constants.CUSTOMER_LOGINTYPE); | |
} | |
/** | |
* @link Constants#CUSTOMER_LOGINTYPE} | |
* @param user | |
* {@Link User} | |
* @return {@Link User} | |
* @since 1.0 | |
*/ | |
public final static void setTypeDistrib(User user) { | |
UserMock.setType(user, Constants.DISTRIB_LOGINTYPE); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment