SimpleStrategy implements ReplicationStrategy { @Override public String createCqlStatement() { return "{" + "'class':'" + getName() + "'," + "'replication_factor':" + getReplicationFactor() + "}"; } SimpleStrategy(int replicationFactor);  SimpleStrategy(); @Override String getName(); int getReplicationFactor(); @Override String createCqlStatement();  }
@Test public void shouldReturnCqlStringWhenValidReplicationFactorGiven() { ReplicationStrategy replicationStrategy = new SimpleStrategy(1); assertThat(replicationStrategy.createCqlStatement(), is(equalTo( "{'class':'SimpleStrategy','replication_factor':1}" ))); }
@Test public void shouldReturnCqlStringWithOneReplicationWhenNoReplicationFactorGiven() { ReplicationStrategy replicationStrategy = new SimpleStrategy(); assertThat(replicationStrategy.createCqlStatement(), is(equalTo( "{'class':'SimpleStrategy','replication_factor':1}" ))); }