### Question:
ScriptConfigurationDataStore implements ScriptingDataStore { @Override public void save(ScriptConfiguration config) throws ScriptException { try { createCollectionConfig(); final Map<String, Set<String>> data = getScriptConfigurationData(config); if (containsGlobalUuid(config.getId())) { getSubGlobalConfig().getSubConfig(config.getId()).setAttributes(data); } if (containsOrgUuid(config.getId())) { getSubOrgConfig().getSubConfig(config.getId()).setAttributes(data); } else { getSubOrgConfig().addSubConfig(config.getId(), SCRIPT_CONFIGURATION, 0, data); } } catch (SSOException | SMSException e) { if(IUMSConstants.SMS_INSUFFICIENT_ACCESS_RIGHTS.equals(e.getErrorCode())) { throw createAndLogError(logger, INSUFFICIENT_PRIVILEGES, e, config.getName()); } throw createAndLogError(logger, SAVE_FAILED, e, config.getId(), realm); } } @Inject  ScriptConfigurationDataStore(@Named("ScriptLogger") Logger logger,
                                        @Assisted Subject subject, @Assisted String realm); @Override void save(ScriptConfiguration config); @Override void delete(String uuid); @Override Set<ScriptConfiguration> getAll(); @Override ScriptConfiguration get(String uuid); @Override boolean containsUuid(String uuid); @Override boolean containsName(String name); @Override Set<ScriptConfiguration> get(QueryFilter<String> queryFilter);  }### Answer:
@Test public void shouldFailIfConfigDoesNotExistOnSave() throws ScriptException { ScriptConfiguration sc = ScriptConfiguration.builder() .generateId() .setName("MyJavaScript") .setScript("var a = 123;var b = 456;") .setLanguage(JAVASCRIPT) .setContext(POLICY_CONDITION).build(); try { dataStore.save(sc); fail("shouldFailIfConfigDoesNotExistOnSave"); } catch (ScriptException e) { assertEquals(e.getScriptErrorCode(), SAVE_FAILED); } }