@Test public void testIsEnabledWhenUsageIsDisabledShouldReturnFalse() { attributes = new DialogDescriptorAttributes("name", DialogDescriptorUsage.DISABLED); dialogDescriptor = new DialogDescriptor(attributes, null, null); boolean actual = underTest.isEnabled(dialogDescriptor); assertEquals(actual, false); }
public boolean isEnabled(final DialogDescriptor dialogDescriptor) { boolean result = false; DialogDescriptorUsage usage = dialogDescriptor.getAttributes().getUsage(); if (usage == DialogDescriptorUsage.DISABLED) { result = false; } else { boolean notTimedOut = isNotTimedOut(dialogDescriptor, usage); if (!notTimedOut) { dialogDescriptor.getAttributes().setUsage(DialogDescriptorUsage.DISABLED); LOGGER.debug("Dialog descriptor '" + dialogDescriptor.getAttributes().getName() + "' was disabled!"); } result = notTimedOut; } return result; }
DialogDescriptorService { public boolean isEnabled(final DialogDescriptor dialogDescriptor) { boolean result = false; DialogDescriptorUsage usage = dialogDescriptor.getAttributes().getUsage(); if (usage == DialogDescriptorUsage.DISABLED) { result = false; } else { boolean notTimedOut = isNotTimedOut(dialogDescriptor, usage); if (!notTimedOut) { dialogDescriptor.getAttributes().setUsage(DialogDescriptorUsage.DISABLED); LOGGER.debug("Dialog descriptor '" + dialogDescriptor.getAttributes().getName() + "' was disabled!"); } result = notTimedOut; } return result; } }
DialogDescriptorService { public boolean isEnabled(final DialogDescriptor dialogDescriptor) { boolean result = false; DialogDescriptorUsage usage = dialogDescriptor.getAttributes().getUsage(); if (usage == DialogDescriptorUsage.DISABLED) { result = false; } else { boolean notTimedOut = isNotTimedOut(dialogDescriptor, usage); if (!notTimedOut) { dialogDescriptor.getAttributes().setUsage(DialogDescriptorUsage.DISABLED); LOGGER.debug("Dialog descriptor '" + dialogDescriptor.getAttributes().getName() + "' was disabled!"); } result = notTimedOut; } return result; }  }
DialogDescriptorService { public boolean isEnabled(final DialogDescriptor dialogDescriptor) { boolean result = false; DialogDescriptorUsage usage = dialogDescriptor.getAttributes().getUsage(); if (usage == DialogDescriptorUsage.DISABLED) { result = false; } else { boolean notTimedOut = isNotTimedOut(dialogDescriptor, usage); if (!notTimedOut) { dialogDescriptor.getAttributes().setUsage(DialogDescriptorUsage.DISABLED); LOGGER.debug("Dialog descriptor '" + dialogDescriptor.getAttributes().getName() + "' was disabled!"); } result = notTimedOut; } return result; }  void decreaseHitcountWhenUsageIsHitcount(final DialogDescriptor dialogDescriptor); boolean isEnabled(final DialogDescriptor dialogDescriptor); }
DialogDescriptorService { public boolean isEnabled(final DialogDescriptor dialogDescriptor) { boolean result = false; DialogDescriptorUsage usage = dialogDescriptor.getAttributes().getUsage(); if (usage == DialogDescriptorUsage.DISABLED) { result = false; } else { boolean notTimedOut = isNotTimedOut(dialogDescriptor, usage); if (!notTimedOut) { dialogDescriptor.getAttributes().setUsage(DialogDescriptorUsage.DISABLED); LOGGER.debug("Dialog descriptor '" + dialogDescriptor.getAttributes().getName() + "' was disabled!"); } result = notTimedOut; } return result; }  void decreaseHitcountWhenUsageIsHitcount(final DialogDescriptor dialogDescriptor); boolean isEnabled(final DialogDescriptor dialogDescriptor);  }