Skip to content

Commit

Permalink
Fix struts latest dep tests (#6143)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurit authored Jun 7, 2022
1 parent a9cc02a commit 532e08f
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import io.opentelemetry.sdk.trace.data.SpanData
import io.opentelemetry.semconv.trace.attributes.SemanticAttributes
import io.opentelemetry.struts.GreetingServlet
import org.eclipse.jetty.server.Server
import org.eclipse.jetty.server.session.HashSessionIdManager
import org.eclipse.jetty.server.session.HashSessionManager
import org.eclipse.jetty.server.session.SessionHandler
import org.eclipse.jetty.servlet.DefaultServlet
import org.eclipse.jetty.servlet.ServletContextHandler
import org.eclipse.jetty.util.resource.FileResource
Expand Down Expand Up @@ -105,6 +108,14 @@ class Struts2ActionSpanTest extends HttpServerTest<Server> implements AgentTestT
context.setBaseResource(resource)
server.setHandler(context)

def sessionIdManager = new HashSessionIdManager()
server.setSessionIdManager(sessionIdManager)
def sessionManager = new HashSessionManager()
def sessionHandler = new SessionHandler(sessionManager)
context.setHandler(sessionHandler)
// disable adding jsessionid to url, affects redirect test
context.setInitParameter("org.eclipse.jetty.servlet.SessionIdPathParameterName", "none")

context.addServlet(DefaultServlet, "/")
context.addServlet(GreetingServlet, "/greetingServlet")
def strutsFilterClass = null
Expand Down

0 comments on commit 532e08f

Please sign in to comment.