Skip to content

Instantly share code, notes, and snippets.

@amixpal
Created November 10, 2014 11:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amixpal/649f6c6d4f165402ab08 to your computer and use it in GitHub Desktop.
Save amixpal/649f6c6d4f165402ab08 to your computer and use it in GitHub Desktop.
@Test
public void getSchedulerSaForIDTest() throws IllegalArgumentException {
LOGGER.info("Testing ->" + this.getClass()
+ ".getSchedulerSaForID(String)...");
String optionKey = "Appointment.Reservations.UserID";
DealerUser dealerUserTest;
try {
List<DealerSetupOption> dso = (List<DealerSetupOption>) commonDBDAO
.getList(
"select dso from DealerSetupOption dso where dso.optionKey =':"
+ optionKey + "'", 1, false);
if ((null == dso.get(0))) {
Long dealerIdTest = dso.get(0).getDealer().getId();
dealerUserTest = dealerDBDao
.getDefaultUserForDealer(dealerIdTest);
} else {
Long dealerIdTest = dso.get(0).getDealer().getId();
dealerUserTest = dealerDBDao.getDealerUserForID(dealerIdTest);
}
DealerUser dealerUser = dealerServiceBO
.getSchedulerSaForID(dealerUserTest.getDealer().getId()
.toString());
if (!CommonTestUtil.compareObjects(dealerUserTest, dealerUser)) {
Assert.fail();
}
} catch (Exception ex) {
LOGGER.error("", ex);
Assert.fail();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment