test_class.file: cassandra-migration/src/test/java/org/cognitor/cassandra/migration/keyspace/NetworkStrategyTest.java
test_class.identifier: NetworkStrategyTest
test_case.body: @Test(expected = IllegalStateException.class)
      public void shouldThrowExceptionWhenNoDatacenterGiven() {
          String json = new NetworkStrategy()
                  .createCqlStatement();
          assertThat(json, is(equalTo("{'class':'NetworkTopologyStrategy'}")));
      }
test_case.class_method_signature: NetworkStrategyTest.shouldThrowExceptionWhenNoDatacenterGiven()
test_case.full_signature: @Test(expected = IllegalStateException.class) public void shouldThrowExceptionWhenNoDatacenterGiven()
test_case.identifier: shouldThrowExceptionWhenNoDatacenterGiven
test_case.invocations: createCqlStatement assertThat is equalTo
test_case.modifiers: @Test(expected = IllegalStateException.class) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldThrowExceptionWhenNoDatacenterGiven()
focal_class.declarator: dataCenters = new HashMap<>()
focal_class.modifier: private final
focal_class.original_string: private final Map<String, Integer> dataCenters = new HashMap<>();
focal_class.type: Map<String, Integer>
focal_class.var_name: dataCenters
focal_class.file: cassandra-migration/src/main/java/org/cognitor/cassandra/migration/keyspace/NetworkStrategy.java
focal_class.identifier: NetworkStrategy
focal_class.interfaces: implements ReplicationStrategy
focal_class.class_method_signature: NetworkStrategy.getName()
focal_class.full_signature: @Override public String getName()
focal_class.identifier: getName
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getName()
focal_class.class_method_signature: NetworkStrategy.createCqlStatement()
focal_class.full_signature: @Override public String createCqlStatement()
focal_class.identifier: createCqlStatement
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String createCqlStatement()
focal_class.class_method_signature: NetworkStrategy.with(String datacenter, int replicationFactor)
focal_class.full_signature: public NetworkStrategy with(String datacenter, int replicationFactor)
focal_class.identifier: with
focal_class.modifiers: public
focal_class.parameters: (String datacenter, int replicationFactor)
focal_class.return: NetworkStrategy
focal_class.signature: NetworkStrategy with(String datacenter, int replicationFactor)
focal_class.class_method_signature: NetworkStrategy.getDataCenters()
focal_class.full_signature: public Map<String, Integer> getDataCenters()
focal_class.identifier: getDataCenters
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Map<String, Integer>
focal_class.signature: Map<String, Integer> getDataCenters()
focal_method.body: @Override
      public String createCqlStatement() {
          if (getDataCenters().isEmpty()) {
              throw new IllegalStateException("There has to be at least one datacenter in order to use NetworkTopologyStrategy.");
          }
  
          StringBuilder builder = new StringBuilder();
          builder.append("{")
                  .append("'class':'").append(getName()).append("',");
  
          builder.append(join(",",
                  dataCenters.keySet().stream().map(dc -> "'" + dc + "':" + dataCenters.get(dc))
                          .collect(toSet())));
          builder.append("}");
          return builder.toString();
      }
focal_method.class_method_signature: NetworkStrategy.createCqlStatement()
focal_method.full_signature: @Override public String createCqlStatement()
focal_method.identifier: createCqlStatement
focal_method.invocations: isEmpty getDataCenters append append append append getName append join collect map stream keySet get toSet append toString
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: String
focal_method.signature: String createCqlStatement()