/**
   * @verifies default to false if timesheet required is not specified
   * @see CashierOptionsServiceGpImpl#getOptions()
   */
  @Test
  public void getOptions_shouldDefaultToFalseIfTimesheetRequiredIsNotSpecified() throws Exception {
    when(adminService.getGlobalProperty(ModuleSettings.RECEIPT_REPORT_ID_PROPERTY))
        .thenReturn(null);
    when(adminService.getGlobalProperty(ModuleSettings.ROUNDING_MODE_PROPERTY)).thenReturn(null);
    when(adminService.getGlobalProperty(ModuleSettings.ROUND_TO_NEAREST_PROPERTY)).thenReturn(null);
    when(adminService.getGlobalProperty(ModuleSettings.ROUNDING_ITEM_ID)).thenReturn(null);
    when(adminService.getGlobalProperty(ModuleSettings.TIMESHEET_REQUIRED_PROPERTY))
        .thenReturn(null);

    CashierOptions options = optionsService.getOptions();

    Assert.assertNotNull(options);
    Assert.assertEquals(false, options.isTimesheetRequired());
  }
 /**
  * @see ICashierOptionsService#getOptions()
  * @verifies Load options
  */
 @Test
 public void getOptions_shouldLoadOptions() throws Exception {
   executeDataSet(OPTIONS_DATASET_VALID);
   executeDataSet(IItemServiceTest.ITEM_DATASET);
   CashierOptions options = cashierOptionsService.getOptions();
   Assert.assertEquals("4028814B399565AA01399681B1B5000E", options.getRoundingItemUuid());
   Assert.assertEquals(3, options.getDefaultReceiptReportId());
   Assert.assertEquals(CashierOptions.RoundingMode.MID, options.getRoundingMode());
   Assert.assertTrue(new BigDecimal(5).equals(options.getRoundToNearest()));
   Assert.assertEquals(true, options.isTimesheetRequired());
 }
  /**
   * @verifies load cashier options from the database
   * @see CashierOptionsServiceGpImpl#getOptions()
   */
  @Test
  public void getOptions_shouldLoadCashierOptionsFromTheDatabase() throws Exception {
    when(adminService.getGlobalProperty(ModuleSettings.RECEIPT_REPORT_ID_PROPERTY)).thenReturn("1");
    when(adminService.getGlobalProperty(ModuleSettings.ROUNDING_MODE_PROPERTY))
        .thenReturn(CashierOptions.RoundingMode.MID.toString());
    when(adminService.getGlobalProperty(ModuleSettings.ROUND_TO_NEAREST_PROPERTY)).thenReturn("5");
    when(adminService.getGlobalProperty(ModuleSettings.ROUNDING_ITEM_ID)).thenReturn("1");
    when(adminService.getGlobalProperty(ModuleSettings.TIMESHEET_REQUIRED_PROPERTY))
        .thenReturn("true");

    Item item = new Item();
    when(itemService.getById(1)).thenReturn(item);

    CashierOptions options = optionsService.getOptions();

    Assert.assertNotNull(options);
    Assert.assertEquals(1, options.getDefaultReceiptReportId());
    Assert.assertEquals(CashierOptions.RoundingMode.MID, options.getRoundingMode());
    Assert.assertEquals(new BigDecimal(5), options.getRoundToNearest());
    Assert.assertEquals(item.getUuid(), options.getRoundingItemUuid());
    Assert.assertEquals(true, options.isTimesheetRequired());
  }
 /**
  * @see ICashierOptionsService#getOptions()
  * @verifies Revert to defaults if there are problems loading options
  */
 @Test
 public void getOptions_shouldRevertToDefaultsIfThereAreProblemsLoadingOptions() throws Exception {
   executeDataSet(OPTIONS_DATASET_INVALID);
   CashierOptions reference = new CashierOptions();
   CashierOptions options = cashierOptionsService.getOptions();
   Assert.assertEquals(reference.getRoundingItemUuid(), options.getRoundingItemUuid());
   Assert.assertEquals(reference.getDefaultReceiptReportId(), options.getDefaultReceiptReportId());
   Assert.assertEquals(reference.getRoundingMode(), options.getRoundingMode());
   Assert.assertEquals(reference.getRoundToNearest(), options.getRoundToNearest());
   Assert.assertEquals(reference.isTimesheetRequired(), options.isTimesheetRequired());
 }