test_class.file: stagemonitor-web-servlet/src/test/java/org/stagemonitor/web/servlet/eum/ClientSpanJavaScriptServletTest.java
test_class.identifier: ClientSpanJavaScriptServletTest
test_case.body: @Test
  	public void testDoGet_returns404IfEumDisabled() throws Exception {
  		// Given
  		ServletPlugin servletPlugin = mockServletPluginWithCacheTime(0);
  		when(servletPlugin.isClientSpanCollectionEnabled()).thenReturn(false);
  		ClientSpanJavaScriptServlet clientSpanJavaScriptServlet = new ClientSpanJavaScriptServlet(servletPlugin);
  		final MockHttpServletResponse response = new MockHttpServletResponse();
  
  		// When
  		clientSpanJavaScriptServlet.doGet(new MockHttpServletRequest(), response);
  
  		// Then
  		assertThat(response.getStatus()).isEqualTo(404);
  		assertThat(response.getContentAsString()).isEmpty();
  	}
test_case.class_method_signature: ClientSpanJavaScriptServletTest.testDoGet_returns404IfEumDisabled()
test_case.full_signature: @Test public void testDoGet_returns404IfEumDisabled()
test_case.identifier: testDoGet_returns404IfEumDisabled
test_case.invocations: mockServletPluginWithCacheTime thenReturn when isClientSpanCollectionEnabled doGet isEqualTo assertThat getStatus isEmpty assertThat getContentAsString
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testDoGet_returns404IfEumDisabled()
focal_class.declarator: MIME_APPLICATION_JAVASCRIPT = "application/javascript"
focal_class.modifier: private static final
focal_class.original_string: private static final String MIME_APPLICATION_JAVASCRIPT = "application/javascript";
focal_class.type: String
focal_class.var_name: MIME_APPLICATION_JAVASCRIPT
focal_class.declarator: ETAG = "etag"
focal_class.modifier: private static final
focal_class.original_string: private static final String ETAG = "etag";
focal_class.type: String
focal_class.var_name: ETAG
focal_class.declarator: IF_NONE_MATCH = "if-none-match"
focal_class.modifier: private static final
focal_class.original_string: private static final String IF_NONE_MATCH = "if-none-match";
focal_class.type: String
focal_class.var_name: IF_NONE_MATCH
focal_class.declarator: MAX_AGE = "max-age="
focal_class.modifier: private static final
focal_class.original_string: private static final String MAX_AGE = "max-age=";
focal_class.type: String
focal_class.var_name: MAX_AGE
focal_class.declarator: NO_CACHE = "no-cache"
focal_class.modifier: private static final
focal_class.original_string: private static final String NO_CACHE = "no-cache";
focal_class.type: String
focal_class.var_name: NO_CACHE
focal_class.declarator: CACHE_CONTROL = "Cache-Control"
focal_class.modifier: static final
focal_class.original_string: static final String CACHE_CONTROL = "Cache-Control";
focal_class.type: String
focal_class.var_name: CACHE_CONTROL
focal_class.declarator: log = LoggerFactory.getLogger(ClientSpanJavaScriptServlet.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(ClientSpanJavaScriptServlet.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: servletPlugin
focal_class.modifier: private final
focal_class.original_string: private final ServletPlugin servletPlugin;
focal_class.type: ServletPlugin
focal_class.var_name: servletPlugin
focal_class.declarator: javaScript
focal_class.modifier: private
focal_class.original_string: private String javaScript;
focal_class.type: String
focal_class.var_name: javaScript
focal_class.declarator: javaScriptEtag
focal_class.modifier: private
focal_class.original_string: private String javaScriptEtag;
focal_class.type: String
focal_class.var_name: javaScriptEtag
focal_class.file: stagemonitor-web-servlet/src/main/java/org/stagemonitor/web/servlet/eum/ClientSpanJavaScriptServlet.java
focal_class.identifier: ClientSpanJavaScriptServlet
focal_class.class_method_signature: ClientSpanJavaScriptServlet.ClientSpanJavaScriptServlet()
focal_class.full_signature: public  ClientSpanJavaScriptServlet()
focal_class.identifier: ClientSpanJavaScriptServlet
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  ClientSpanJavaScriptServlet()
focal_class.class_method_signature: ClientSpanJavaScriptServlet.ClientSpanJavaScriptServlet(ServletPlugin servletPlugin)
focal_class.full_signature: public  ClientSpanJavaScriptServlet(ServletPlugin servletPlugin)
focal_class.identifier: ClientSpanJavaScriptServlet
focal_class.modifiers: public
focal_class.parameters: (ServletPlugin servletPlugin)
focal_class.signature:  ClientSpanJavaScriptServlet(ServletPlugin servletPlugin)
focal_class.class_method_signature: ClientSpanJavaScriptServlet.rebuildJavaScriptAndEtag()
focal_class.full_signature: public void rebuildJavaScriptAndEtag()
focal_class.identifier: rebuildJavaScriptAndEtag
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void rebuildJavaScriptAndEtag()
focal_class.class_method_signature: ClientSpanJavaScriptServlet.generateEtag(String javaScript)
focal_class.full_signature: private String generateEtag(String javaScript)
focal_class.identifier: generateEtag
focal_class.modifiers: private
focal_class.parameters: (String javaScript)
focal_class.return: String
focal_class.signature: String generateEtag(String javaScript)
focal_class.class_method_signature: ClientSpanJavaScriptServlet.concatenateJavaScript(List<ClientSpanExtension> clientSpanExtensions)
focal_class.full_signature: private String concatenateJavaScript(List<ClientSpanExtension> clientSpanExtensions)
focal_class.identifier: concatenateJavaScript
focal_class.modifiers: private
focal_class.parameters: (List<ClientSpanExtension> clientSpanExtensions)
focal_class.return: String
focal_class.signature: String concatenateJavaScript(List<ClientSpanExtension> clientSpanExtensions)
focal_class.class_method_signature: ClientSpanJavaScriptServlet.doGet(HttpServletRequest req, HttpServletResponse resp)
focal_class.full_signature: @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp)
focal_class.identifier: doGet
focal_class.modifiers: @Override protected
focal_class.parameters: (HttpServletRequest req, HttpServletResponse resp)
focal_class.return: void
focal_class.signature: void doGet(HttpServletRequest req, HttpServletResponse resp)
focal_class.class_method_signature: ClientSpanJavaScriptServlet.isInClientCache(HttpServletRequest req)
focal_class.full_signature: private boolean isInClientCache(HttpServletRequest req)
focal_class.identifier: isInClientCache
focal_class.modifiers: private
focal_class.parameters: (HttpServletRequest req)
focal_class.return: boolean
focal_class.signature: boolean isInClientCache(HttpServletRequest req)
focal_class.class_method_signature: ClientSpanJavaScriptServlet.wrapImmediateInvokedFunctionExpression(String toWrap)
focal_class.full_signature: private String wrapImmediateInvokedFunctionExpression(String toWrap)
focal_class.identifier: wrapImmediateInvokedFunctionExpression
focal_class.modifiers: private
focal_class.parameters: (String toWrap)
focal_class.return: String
focal_class.signature: String wrapImmediateInvokedFunctionExpression(String toWrap)
focal_class.class_method_signature: ClientSpanJavaScriptServlet.getCacheControlMaxAge()
focal_class.full_signature: private String getCacheControlMaxAge()
focal_class.identifier: getCacheControlMaxAge
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getCacheControlMaxAge()
focal_class.superclass: extends HttpServlet
focal_method.body: @Override
  	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
  		if (servletPlugin.isClientSpanCollectionEnabled()) {
  			resp.setHeader(ETAG, javaScriptEtag);
  			resp.setHeader(CACHE_CONTROL, getCacheControlMaxAge());
  			if (isInClientCache(req)) {
  				resp.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
  			} else {
  				resp.setContentType(MIME_APPLICATION_JAVASCRIPT);
  				resp.getWriter().write(javaScript);
  			}
  		} else {
  			log.debug("Client span collection is disabled");
  			resp.sendError(HttpServletResponse.SC_NOT_FOUND);
  		}
  	}
focal_method.class_method_signature: ClientSpanJavaScriptServlet.doGet(HttpServletRequest req, HttpServletResponse resp)
focal_method.full_signature: @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp)
focal_method.identifier: doGet
focal_method.invocations: isClientSpanCollectionEnabled setHeader setHeader getCacheControlMaxAge isInClientCache setStatus setContentType write getWriter debug sendError
focal_method.modifiers: @Override protected
focal_method.parameters: (HttpServletRequest req, HttpServletResponse resp)
focal_method.return: void
focal_method.signature: void doGet(HttpServletRequest req, HttpServletResponse resp)