Skip to content

Commit 2720baa

Browse files
authored
Merge pull request #158 from bugsnag/tom/fix-mr-failure-springapp
test(mazerunner): fix failing tests for plain spring app due to tomcat root change
2 parents af39295 + 42dfae1 commit 2720baa

File tree

8 files changed

+15
-9
lines changed

8 files changed

+15
-9
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
source 'https://rubygems.org'
22

3-
gem 'bugsnag-maze-runner', :git => 'https://github.com/bugsnag/maze-runner'
3+
gem 'bugsnag-maze-runner', :git => 'https://github.com/bugsnag/maze-runner', :branch => 'v1'
44
gem 'os'

features/async_method.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Scenario: Notify an exception from a spring boot async method
3131

3232
Scenario: Report an exception from a plain spring async method
3333
Given I run the plain spring app
34-
When I navigate to the route "/mazerunnerplainspring/run-async-task" on port "1235"
34+
When I navigate to the route "/run-async-task" on port "1235"
3535
Then I should receive a request
3636
And the request is a valid for the error reporting API
3737
And the request used the Spring notifier
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
FROM tomcat:7.0
22

3-
COPY /build/libs/mazerunnerplainspring.war /usr/local/tomcat/webapps/mazerunnerplainspring.war
3+
COPY /build/libs/mazerunnerplainspring.war /usr/local/tomcat/webapps/ROOT.war

features/fixtures/mazerunnerplainspring/src/main/java/com.bugsnag.mazerunnerplainspring/TestRestController.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ public class TestRestController {
2727
@Autowired
2828
private AsyncMethodService asyncMethodService;
2929

30+
@RequestMapping("/")
31+
public String ping() {
32+
return "Plain Spring Fixture app ready for connections";
33+
}
34+
3035
@RequestMapping("/send-unhandled-exception")
3136
public void sendUnhandledException() {
3237
throw new RuntimeException("Unhandled exception from TestRestController");

features/meta_data.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ Scenario: Test logback appender with thread meta data
144144

145145
Scenario: Test thread meta data in plain spring async method
146146
Given I run the plain spring app
147-
When I navigate to the route "/mazerunnerplainspring/run-async-task" on port "1235"
147+
When I navigate to the route "/run-async-task" on port "1235"
148148
Then I should receive a request
149149
And the request is a valid for the error reporting API
150150
And the event "metaData.thread.key1" is null

features/rest_controller.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ Scenario: Report an exception from a spring boot rest controller
1818

1919
Scenario: Report an exception from a plain spring rest controller
2020
Given I run the plain spring app
21-
When I navigate to the route "/mazerunnerplainspring/send-unhandled-exception" on port "1235"
21+
When I navigate to the route "/send-unhandled-exception" on port "1235"
2222
Then I should receive a request
2323
And the request is a valid for the error reporting API
2424
And the request used the Spring notifier
2525
And the "Bugsnag-API-Key" header equals "a35a2a72bd230ac0aa0f52715bbdc6aa"
2626
And the payload field "events" is an array with 1 element
2727
And the event "unhandled" is true
2828
And the event "severity" equals "error"
29-
And the event "context" equals "GET /mazerunnerplainspring/send-unhandled-exception"
29+
And the event "context" equals "GET /send-unhandled-exception"
3030
And the exception "errorClass" equals "java.lang.RuntimeException"
3131
And the exception "message" equals "Unhandled exception from TestRestController"
3232
And the event "metaData.request.url" ends with "/send-unhandled-exception"

features/session_tracking_auto.feature

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ Scenario: Report automatic session from a spring boot app
1414
Scenario: Report automatic session from a plain spring app
1515
Given I set environment variable "AUTO_CAPTURE_SESSIONS" to "true"
1616
And I run the plain spring app
17-
When I navigate to the route "/mazerunnerplainspring/add-session" on port "1235"
17+
When I navigate to the route "/add-session" on port "1235"
1818
Then I should receive a request
1919
And the request is a valid for the session tracking API
2020
And the "Bugsnag-API-Key" header equals "a35a2a72bd230ac0aa0f52715bbdc6aa"
2121
And the payload field "sessionCounts" is an array with 1 element
2222
And the payload field "sessionCounts.0.startedAt" is not null
23-
And the payload field "sessionCounts.0.sessionsStarted" equals 1
23+
And the payload field "sessionCounts.0.sessionsStarted" equals 2
24+
# (1 session for the start-up check on "/" and the second for "/add-session")
2425
And the payload field "app" is not null
2526
And the payload field "app.version" equals "1.0.0"

features/steps/build_steps.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
When("I run plain Spring {string} with the defaults") do |eventType|
4141
steps %Q{
4242
And I run the plain spring app
43-
And I navigate to the route "/mazerunnerplainspring/run-scenario/#{eventType}" on port "1235"
43+
And I navigate to the route "/run-scenario/#{eventType}" on port "1235"
4444
}
4545
end
4646

0 commit comments

Comments
 (0)