/** * Returns a stream view of the provided string. * * @param expectedFilename the filename we expect the connector to open * @param contents the contents to return */ static InputStreamProvider fileContentsFromString(final String expectedFilename, final String contents) { return fileContentsFromStream(expectedFilename, new ByteArrayInputStream(contents.getBytes(UTF_8))); } }
@Before public void useTestUris() { InputStream testUrisProperties = getClass().getClassLoader().getResourceAsStream(PROPERTY_FILE_WITH_URIS); env.setSystemProperty(LocalConfigConnector.PROPERTIES_FILE_PROPERTY, PROPERTY_FILE_WITH_URIS); connector.setFileProvider(StubbedOpenFileLocalConfigConnector.fileContentsFromStream(PROPERTY_FILE_WITH_URIS, testUrisProperties)); assertTrue(connector.isInMatchingCloud()); } }