@Test public void testAppHasAGreeting() { App classUnderTest = new App(); assertNotNull("app should have a connect", classUnderTest.connect()); }
public synchronized Boolean connect() { logger.info("connecting to cassandra"); DriverConfigLoader loader = DriverConfigLoader.programmaticBuilder() .withDuration(DefaultDriverOption.REQUEST_TIMEOUT, Duration.ofSeconds(5)) .startProfile("slow") .withDuration(DefaultDriverOption.REQUEST_TIMEOUT, Duration.ofSeconds(30)) .endProfile() .build(); session = CqlSession.builder().withConfigLoader(loader) .addContactPoint(new InetSocketAddress("localhost", 9041)) .withLocalDatacenter("datacenter1") .build(); logger.info("connected"); return true; }
App { public synchronized Boolean connect() { logger.info("connecting to cassandra"); DriverConfigLoader loader = DriverConfigLoader.programmaticBuilder() .withDuration(DefaultDriverOption.REQUEST_TIMEOUT, Duration.ofSeconds(5)) .startProfile("slow") .withDuration(DefaultDriverOption.REQUEST_TIMEOUT, Duration.ofSeconds(30)) .endProfile() .build(); session = CqlSession.builder().withConfigLoader(loader) .addContactPoint(new InetSocketAddress("localhost", 9041)) .withLocalDatacenter("datacenter1") .build(); logger.info("connected"); return true; } }
App { public synchronized Boolean connect() { logger.info("connecting to cassandra"); DriverConfigLoader loader = DriverConfigLoader.programmaticBuilder() .withDuration(DefaultDriverOption.REQUEST_TIMEOUT, Duration.ofSeconds(5)) .startProfile("slow") .withDuration(DefaultDriverOption.REQUEST_TIMEOUT, Duration.ofSeconds(30)) .endProfile() .build(); session = CqlSession.builder().withConfigLoader(loader) .addContactPoint(new InetSocketAddress("localhost", 9041)) .withLocalDatacenter("datacenter1") .build(); logger.info("connected"); return true; }  }
App { public synchronized Boolean connect() { logger.info("connecting to cassandra"); DriverConfigLoader loader = DriverConfigLoader.programmaticBuilder() .withDuration(DefaultDriverOption.REQUEST_TIMEOUT, Duration.ofSeconds(5)) .startProfile("slow") .withDuration(DefaultDriverOption.REQUEST_TIMEOUT, Duration.ofSeconds(30)) .endProfile() .build(); session = CqlSession.builder().withConfigLoader(loader) .addContactPoint(new InetSocketAddress("localhost", 9041)) .withLocalDatacenter("datacenter1") .build(); logger.info("connected"); return true; }  static void main(String[] args); synchronized Boolean connect(); }
App { public synchronized Boolean connect() { logger.info("connecting to cassandra"); DriverConfigLoader loader = DriverConfigLoader.programmaticBuilder() .withDuration(DefaultDriverOption.REQUEST_TIMEOUT, Duration.ofSeconds(5)) .startProfile("slow") .withDuration(DefaultDriverOption.REQUEST_TIMEOUT, Duration.ofSeconds(30)) .endProfile() .build(); session = CqlSession.builder().withConfigLoader(loader) .addContactPoint(new InetSocketAddress("localhost", 9041)) .withLocalDatacenter("datacenter1") .build(); logger.info("connected"); return true; }  static void main(String[] args); synchronized Boolean connect();  }