StringDataStore { public String storeData(String cookieData) { try { String token = generateToken(); ensureSpaceExists(); s3StorageProvider.addHiddenContent(this.hiddenSpaceName, token, Constants.MEDIA_TYPE_APPLICATION_JSON, IOUtil.writeStringToStream(cookieData)); return token; } catch (Exception e) { throw new DuraCloudRuntimeException(e); } } StringDataStore(String hiddenSpaceName, S3StorageProvider s3StorageProvider); String storeData(String cookieData); String retrieveData(String token);  }
@Test public void testStoreData() throws Exception { expect(storageProvider.spaceExists(hiddenSpaceName)).andReturn(false); expect(storageProvider.createHiddenSpace(eq(hiddenSpaceName), eq(1))).andReturn(hiddenSpaceName); expect(storageProvider .addHiddenContent(eq(hiddenSpaceName), isA(String.class), isA(String.class), isA(InputStream.class))) .andReturn("etag"); replayAll(); String token = this.stringDataStore.storeData(cookieData); assertNotNull("token must not be null", token); }