/** * Add label type. */ @Test public void addLabelTypeAction() { AbstractStorageLabelType<?> labelType = mock(AbstractStorageLabelType.class); addLabelManagementAction = new AddLabelManagementAction(labelType); addLabelManagementAction.execute(storageService); verify(storageService, times(1)).saveLabelType(labelType); verifyNoMoreInteractions(storageService); }
/** * {@inheritDoc} */ @Override public void execute(IStorageService storageService) { if (isLabelTypeBasedAction()) { storageService.saveLabelType(this.getLabelType()); } else if (isLabelBasedAction()) { for (AbstractStorageLabel<?> label : this.getLabelList()) { storageService.saveLabelToCmr(label); } } }