This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Inject | |
private Session session; | |
@Inject | |
private MetricRegistry metricRegistry; | |
@Bean | |
public MetricRegistry metricRegistry() { | |
return session.getCluster().getMetrics().getRegistry(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
compile("org.springframework.boot:spring-boot-starter-actuator") | |
compile("com.datastax.cassandra:cassandra-driver-core:${cassandraDriverVersion}") | |
compile("com.datastax.cassandra:cassandra-driver-mapping:${cassandraDriverVersion}") | |
compile("io.dropwizard.metrics:metrics-core:3.1.0") | |
compile("io.dropwizard.metrics:metrics-graphite:3.1.0") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BasicSimulation extends Simulation { | |
val app: ConfigurableApplicationContext = SpringApplication.run(classOf[Application]) | |
Runtime.getRuntime.addShutdownHook(new Thread() { | |
override def run(): Unit = app.stop() | |
}) | |
val httpConf = http | |
.baseURL("http://localhost:8080") | |
.doNotTrackHeader("1") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task runLoadTest(type: JavaExec) { | |
classpath = sourceSets.main.runtimeClasspath + sourceSets.test.runtimeClasspath + sourceSets.e2eTest.runtimeClasspath | |
jvmArgs = [ '-Dgatling.core.directory.binaries=./build/classes/e2eTest' ] | |
// Gatling application | |
main = "io.gatling.app.Gatling" | |
// Specify the simulation to run | |
args = Eval.me("['-s', 'BasicSimulation']") | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package info.batey.killrauction; | |
import cucumber.api.CucumberOptions; | |
import cucumber.api.junit.Cucumber; | |
import org.junit.runner.RunWith; | |
@RunWith(Cucumber.class) | |
@CucumberOptions(features = "src/e2etest/resources/" ) | |
public class RunEndToEndTests { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies { | |
// cucumber tests | |
testCompile("org.springframework.boot:spring-boot-starter-test") | |
testCompile("info.cukes:cucumber-junit:${cucumberVersion}") | |
testCompile("info.cukes:cucumber-spring:${cucumberVersion}") | |
// for performance testing | |
testCompile "org.scala-lang:scala-library:2.11.5" | |
testCompile "io.gatling:gatling-app:${gatlingVersion}" | |
testCompile "io.gatling.highcharts:gatling-charts-highcharts:${gatlingVersion}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sourceSets { | |
e2eTest { | |
java { | |
srcDir 'src/e2etest/java' | |
} | |
resources { | |
srcDir 'src/e2etest/resources' | |
} | |
compileClasspath += sourceSets.main.runtimeClasspath | |
compileClasspath += sourceSets.test.compileClasspath |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UserWithSalt extends User { | |
private Long salt; | |
public UserWithSalt(String username, Long salt, String password, Collection<? extends GrantedAuthority> authorities) { | |
super(username, password, authorities); | |
this.salt = salt; | |
} | |
public Long getSalt() { | |
return salt; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component | |
public class CassandraUserDetailsService implements UserDetailsService { | |
private AuctionUserDao auctionUserDao; | |
@Inject | |
public CassandraUserDetailsService(AuctionUserDao auctionUserDao) { | |
this.auctionUserDao = auctionUserDao; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface AuctionUserDao { | |
public boolean createUser(UserCreate userCreate); | |
public Optional<AuctionUser> retrieveUser(String userName); | |
} |