Skip to content

Commit 9ee68e3

Browse files
committed
Fix benchmarks
1 parent a5a9cf2 commit 9ee68e3

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

apm-agent-benchmarks/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@
4242
<artifactId>javax.servlet-api</artifactId>
4343
<version>3.0.1</version>
4444
</dependency>
45+
<dependency>
46+
<groupId>org.springframework</groupId>
47+
<artifactId>spring-test</artifactId>
48+
<version>${version.spring}</version>
49+
</dependency>
4550
<dependency>
4651
<groupId>com.h2database</groupId>
4752
<artifactId>h2</artifactId>

apm-agent-benchmarks/src/main/java/co/elastic/apm/agent/benchmark/MockHttpServletRequest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
*/
2020
package co.elastic.apm.agent.benchmark;
2121

22+
import org.springframework.mock.web.MockServletContext;
23+
2224
import javax.servlet.AsyncContext;
2325
import javax.servlet.DispatcherType;
2426
import javax.servlet.RequestDispatcher;
@@ -56,6 +58,7 @@ public class MockHttpServletRequest implements HttpServletRequest {
5658
private String requestURI;
5759
private String servletPath;
5860
private String serverName;
61+
private MockServletContext servletContext = new MockServletContext();
5962

6063
public MockHttpServletRequest(String method, String requestUrl) {
6164
this.method = method;
@@ -372,7 +375,7 @@ public int getLocalPort() {
372375

373376
@Override
374377
public ServletContext getServletContext() {
375-
return null;
378+
return servletContext;
376379
}
377380

378381
@Override

0 commit comments

Comments
 (0)