public String extractAppIdFromRequest(HttpServletRequest request) {
    String appId = null;
    String servletPath = request.getServletPath();

    if (StringUtils.startsWith(servletPath, URL_CONFIGS_PREFIX)) {
      appId = StringUtils.substringBetween(servletPath, URL_CONFIGS_PREFIX, URL_SEPARATOR);
    } else if (StringUtils.startsWith(servletPath, URL_CONFIGFILES_JSON_PREFIX)) {
      appId = StringUtils.substringBetween(servletPath, URL_CONFIGFILES_JSON_PREFIX, URL_SEPARATOR);
    } else if (StringUtils.startsWith(servletPath, URL_CONFIGFILES_PREFIX)) {
      appId = StringUtils.substringBetween(servletPath, URL_CONFIGFILES_PREFIX, URL_SEPARATOR);
    } else if (StringUtils.startsWith(servletPath, URL_NOTIFICATIONS_PREFIX)) {
      appId = request.getParameter("appId");
    }

    return appId;
  }
@Test
  public void testExtractAppIdFromRequest3() {
    when(request.getServletPath()).thenReturn("/configfiles/someAppId/default/application");

    String appId = accessKeyUtil.extractAppIdFromRequest(request);

    assertThat(appId).isEqualTo("someAppId");
  }