@Test public void testDecreaseWhenUsageIsNotHitcountShouldDoNothing() { attributes = new DialogDescriptorAttributes("name", DialogDescriptorUsage.ALWAYS); dialogDescriptor = new DialogDescriptor(attributes, null, null); underTest.decreaseHitcountWhenUsageIsHitcount(dialogDescriptor); assertEquals(dialogDescriptor.getAttributes().getUsage(), DialogDescriptorUsage.ALWAYS); }
public void decreaseHitcountWhenUsageIsHitcount(final DialogDescriptor dialogDescriptor) { if (dialogDescriptor.getAttributes().getUsage() == DialogDescriptorUsage.HITCOUNT) { long validityValue = dialogDescriptor.getAttributes().decreaseHitcount(); LOGGER.debug("Hitcount was decreased to " + validityValue + " in dialog descriptor '" + dialogDescriptor.getAttributes().getName() + "'!"); if (validityValue == 0) { dialogDescriptor.getAttributes().setUsage(DialogDescriptorUsage.DISABLED); LOGGER.debug("Dialog descriptor '" + dialogDescriptor.getAttributes().getName() + "' was disabled!"); } } }
DialogDescriptorService { public void decreaseHitcountWhenUsageIsHitcount(final DialogDescriptor dialogDescriptor) { if (dialogDescriptor.getAttributes().getUsage() == DialogDescriptorUsage.HITCOUNT) { long validityValue = dialogDescriptor.getAttributes().decreaseHitcount(); LOGGER.debug("Hitcount was decreased to " + validityValue + " in dialog descriptor '" + dialogDescriptor.getAttributes().getName() + "'!"); if (validityValue == 0) { dialogDescriptor.getAttributes().setUsage(DialogDescriptorUsage.DISABLED); LOGGER.debug("Dialog descriptor '" + dialogDescriptor.getAttributes().getName() + "' was disabled!"); } } } }
DialogDescriptorService { public void decreaseHitcountWhenUsageIsHitcount(final DialogDescriptor dialogDescriptor) { if (dialogDescriptor.getAttributes().getUsage() == DialogDescriptorUsage.HITCOUNT) { long validityValue = dialogDescriptor.getAttributes().decreaseHitcount(); LOGGER.debug("Hitcount was decreased to " + validityValue + " in dialog descriptor '" + dialogDescriptor.getAttributes().getName() + "'!"); if (validityValue == 0) { dialogDescriptor.getAttributes().setUsage(DialogDescriptorUsage.DISABLED); LOGGER.debug("Dialog descriptor '" + dialogDescriptor.getAttributes().getName() + "' was disabled!"); } } }  }
DialogDescriptorService { public void decreaseHitcountWhenUsageIsHitcount(final DialogDescriptor dialogDescriptor) { if (dialogDescriptor.getAttributes().getUsage() == DialogDescriptorUsage.HITCOUNT) { long validityValue = dialogDescriptor.getAttributes().decreaseHitcount(); LOGGER.debug("Hitcount was decreased to " + validityValue + " in dialog descriptor '" + dialogDescriptor.getAttributes().getName() + "'!"); if (validityValue == 0) { dialogDescriptor.getAttributes().setUsage(DialogDescriptorUsage.DISABLED); LOGGER.debug("Dialog descriptor '" + dialogDescriptor.getAttributes().getName() + "' was disabled!"); } } }  void decreaseHitcountWhenUsageIsHitcount(final DialogDescriptor dialogDescriptor); boolean isEnabled(final DialogDescriptor dialogDescriptor); }
DialogDescriptorService { public void decreaseHitcountWhenUsageIsHitcount(final DialogDescriptor dialogDescriptor) { if (dialogDescriptor.getAttributes().getUsage() == DialogDescriptorUsage.HITCOUNT) { long validityValue = dialogDescriptor.getAttributes().decreaseHitcount(); LOGGER.debug("Hitcount was decreased to " + validityValue + " in dialog descriptor '" + dialogDescriptor.getAttributes().getName() + "'!"); if (validityValue == 0) { dialogDescriptor.getAttributes().setUsage(DialogDescriptorUsage.DISABLED); LOGGER.debug("Dialog descriptor '" + dialogDescriptor.getAttributes().getName() + "' was disabled!"); } } }  void decreaseHitcountWhenUsageIsHitcount(final DialogDescriptor dialogDescriptor); boolean isEnabled(final DialogDescriptor dialogDescriptor);  }