Skip to content

Commit

Permalink
Unite integration tests scenarios into one test
Browse files Browse the repository at this point in the history
  • Loading branch information
eyalkoren committed Dec 25, 2018
1 parent 81dff7a commit f21f25d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,13 @@ public final void stopServer() {
}

@Test
public void testTransactionReporting() throws Exception {
public void testAllScenarios() throws Exception {
testTransactionReporting();
testTransactionErrorReporting();
testSpanErrorReporting();
}

private void testTransactionReporting() throws Exception {
for (String pathToTest : getPathsToTest()) {
mockServerContainer.getClient().clear(HttpRequest.request(), ClearType.LOG);
executeRequest(pathToTest, "Hello World", 200);
Expand All @@ -186,8 +192,7 @@ public void testTransactionReporting() throws Exception {
}
}

@Test
public void testSpanErrorReporting() throws Exception {
private void testSpanErrorReporting() throws Exception {
for (String pathToTest : getPathsToTest()) {
mockServerContainer.getClient().clear(HttpRequest.request(), ClearType.LOG);
executeRequest(pathToTest + "?cause_db_error=true", "DB Error", 200);
Expand All @@ -197,8 +202,7 @@ public void testSpanErrorReporting() throws Exception {
}
}

@Test
public void testTransactionErrorReporting() throws Exception {
private void testTransactionErrorReporting() throws Exception {
for (String pathToTest : getPathsToTestErrors()) {
mockServerContainer.getClient().clear(HttpRequest.request(), ClearType.LOG);
executeRequest(pathToTest + "?cause_transaction_error=true", "", 500);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ public class TomcatIT extends AbstractServletContainerIntegrationTest {
public TomcatIT(final String tomcatVersion) {
super(new GenericContainer<>("tomcat:" + tomcatVersion)
.withNetwork(Network.SHARED)
.withEnv("CATALINA_OPTS", "-javaagent:/elastic-apm-agent.jar -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005")
.withEnv("JPDA_ADDRESS", "5005")
.withEnv("JPDA_TRANSPORT", "dt_socket")
.withEnv("CATALINA_OPTS", "-javaagent:/elastic-apm-agent.jar")
.withEnv("ELASTIC_APM_SERVER_URL", "http://apm-server:1080")
.withEnv("ELASTIC_APM_IGNORE_URLS", "/status*,/favicon.ico")
.withEnv("ELASTIC_APM_REPORT_SYNC", "true")
Expand Down

0 comments on commit f21f25d

Please sign in to comment.