### Question:
DataCacheServiceImpl extends AbstractDataUtilsServiceImpl implements DataCacheService { @Override public String putSerializedEncryptedObjectIntoCache(final Object informationObject, final String key) throws JargonException { if (informationObject == null) { throw new IllegalArgumentException("null informationObject"); } checkContracts(); log.info("putInformationIntoCache()"); log.info("checking on purge of old requests..."); if (getCacheServiceConfiguration().isDoCleanupDuringRequests()) { purgeOldRequests(); } int keyHash = key.hashCode(); log.info("generated hash for key:{}", keyHash); log.info("serializing object to byte buffer..."); byte[] serializedObject = serializeObjectToByteStream(informationObject, key); log.info("object serialized into:{} bytes", serializedObject.length); log.info("encrypting..."); CacheEncryptor cacheEncryptor = new CacheEncryptor(key); byte[] encrypted = cacheEncryptor.encrypt(serializedObject); log.info("bytes now encrypted for length:{}", encrypted.length); String irodsFileAbsolutePath = buildIRODSFileAbsolutePath(keyHash, irodsAccount.getUserName()); log.info("storing to file at absolute path: {}", irodsFileAbsolutePath); IRODSFile cacheFile = getIrodsAccessObjectFactory().getIRODSFileFactory(irodsAccount) .instanceIRODSFile(irodsFileAbsolutePath); createCacheFileAndCacheDir(cacheFile); Stream2StreamAO stream2StreamAO = getIrodsAccessObjectFactory().getStream2StreamAO(irodsAccount); stream2StreamAO.streamBytesToIRODSFile(encrypted, cacheFile); log.info("done..."); return irodsFileAbsolutePath; } DataCacheServiceImpl(final IRODSAccessObjectFactory irodsAccessObjectFactory,
			final IRODSAccount irodsAccount);  DataCacheServiceImpl(); @Override String putStringValueIntoCache(final String stringToCache, final String key); @Override String retrieveStringValueFromCache(final String userName, final String key); @Override String putSerializedEncryptedObjectIntoCache(final Object informationObject, final String key); @Override Object retrieveObjectFromCache(final String userName, final String key); @Override void purgeOldRequests(); @Override void setCacheServiceConfiguration(final CacheServiceConfiguration cacheServiceConfiguration); @Override CacheServiceConfiguration getCacheServiceConfiguration(); static final Logger log; }### Answer:
@Test(expected = JargonRuntimeException.class) public void testPutInformationIntoCacheMissingIRODSAccount() throws Exception { DataCacheService accountCacheService = new DataCacheServiceImpl(); accountCacheService.setIrodsAccessObjectFactory(Mockito.mock(IRODSAccessObjectFactory.class)); accountCacheService.putSerializedEncryptedObjectIntoCache("obj", "key"); }
@Test(expected = JargonRuntimeException.class) public void testPutInformationIntoCacheMissingIRODSAccessObjectFactory() throws Exception { DataCacheService accountCacheService = new DataCacheServiceImpl(); accountCacheService .setIrodsAccount(testingPropertiesHelper.buildIRODSAccountFromTestProperties(testingProperties)); accountCacheService.putSerializedEncryptedObjectIntoCache("obj", "key"); }