@After public void cleanup() throws IOException { FileUtils.deleteDirectory(baseFile); try { zk.close(); } catch (Exception e) { throw new RuntimeException(e); } }
@Before public void init() { initializeConfigs(); baseFile = new File("target/blob-store-test-"+UUID.randomUUID()); base = baseFile.toURI(); try { zk = new InProcessZookeeper(); } catch (Exception e) { throw new RuntimeException(e); } }
private LocalFsBlobStore initLocalFs() { LocalFsBlobStore store = new LocalFsBlobStore(); // Spy object that tries to mock the real object store LocalFsBlobStore spy = spy(store); Mockito.doNothing().when(spy).checkForBlobUpdate("test"); Mockito.doNothing().when(spy).checkForBlobUpdate("other"); Mockito.doNothing().when(spy).checkForBlobUpdate("test-empty-subject-WE"); Mockito.doNothing().when(spy).checkForBlobUpdate("test-empty-subject-DEF"); Mockito.doNothing().when(spy).checkForBlobUpdate("test-empty-acls"); Map<String, Object> conf = Utils.readStormConfig(); conf.put(Config.STORM_ZOOKEEPER_PORT, zk.getPort()); conf.put(Config.STORM_LOCAL_DIR, baseFile.getAbsolutePath()); conf.put(Config.STORM_PRINCIPAL_TO_LOCAL_PLUGIN,"org.apache.storm.security.auth.DefaultPrincipalToLocal"); NimbusInfo nimbusInfo = new NimbusInfo("localhost", 0, false); spy.prepare(conf, null, nimbusInfo, null); return spy; }
conf.put(Config.STORM_ZOOKEEPER_PORT, zk.getPort());
if (zookeeper != null) { LOG.info("Shutting down in process zookeeper"); zookeeper.close(); LOG.info("Done shutting down in process zookeeper");
try (InProcessZookeeper zk = new InProcessZookeeper()) { withServer(MISSING_CLIENT, DigestSaslTransportPlugin.class,