### Question:
ScriptConfigurationService implements ScriptingService, ServiceListener { @Override public void delete(String uuid) throws ScriptException { Reject.ifTrue(lock.getReadHoldCount() > 0, "Should not already be locked for reading"); lock.readLock().lock(); try { failIfUuidDoesNotExist(uuid); ScriptConfiguration scriptConfig = get(uuid); if (containsGlobalUuid(uuid) || isDefaultScript(scriptConfig)) { throw new ScriptException(DELETING_DEFAULT_SCRIPT, scriptConfig.getName()); } lock.readLock().unlock(); lock.writeLock().lock(); try { int usageCount = getUsageCount(scriptConfig); if (usageCount > 0) { if (usageCount == 1) { throw new ScriptException(DELETING_SCRIPT_IN_USE_SINGULAR, scriptConfig.getName()); } throw new ScriptException(DELETING_SCRIPT_IN_USE_PLURAL, scriptConfig.getName(), Integer.toString(usageCount)); } getSubOrgConfig().removeSubConfig(uuid); realmConfigurations.remove(uuid); } catch (SSOException | SMSException e) { throw createAndLogError(logger, DELETE_FAILED, e, uuid, realm); } finally { lock.readLock().lock(); lock.writeLock().unlock(); } } finally { lock.readLock().unlock(); } } @Inject  ScriptConfigurationService(Logger logger, String realm, CoreWrapper coreWrapper, ServiceConfigManager scm); @Override ScriptConfiguration create(ScriptConfiguration config, Subject subject); @Override ScriptConfiguration update(ScriptConfiguration config, Subject subject); @Override void delete(String uuid); @Override Set<ScriptConfiguration> getAll(); @Override ScriptConfiguration get(String uuid); @Override Set<ScriptConfiguration> get(QueryFilter<String> queryFilter); @Override void schemaChanged(String serviceName, String version); @Override void globalConfigChanged(String serviceName, String version, String groupName, String serviceComponent,
            int type); @Override void organizationConfigChanged(String serviceName, String version, String orgName, String groupName,
            String serviceComponent, int type);  }### Answer:
@Test public void shouldFailIfUuidDoesNotExistOnDelete() throws ScriptException { try { service.delete("1234567890"); fail("shouldFailIfUuidDoesNotExistOnDelete"); } catch (ScriptException e) { assertEquals(e.getScriptErrorCode(), SCRIPT_UUID_NOT_FOUND); } }