Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hoist up Node Gradle plugin, set TestTomcat baseDir, add hasContentType matcher, HTTP status consts #7

Merged
merged 3 commits into from
Nov 25, 2023

Commits on Nov 25, 2023

  1. Hoist Node Gradle plugin up to settings.gradle.kts

    settings.gradle.kts seems a better place to specify the versions of
    Gradle plugins than in the project specific build.gradle.kts files.
    mbland committed Nov 25, 2023
    Configuration menu
    Copy the full SHA
    125a02e View commit details
    Browse the repository at this point in the history
  2. Set TestTomcat baseDir explicitly

    This is in preparation for possibly launching a TestTomcat per test
    method, instead of per test fixture/suite.
    
    I found out that trying to dynamically create a baseDir for each
    instance led to the first instance's baseDir reappearing. I haven't been
    able to see clearly how this is happening, but it seems that:
    
    1. The baseDir isn't strictly necessary in our case, since we're not
       running JSPs.
    2. Using the same build/test-tomcat baseDir for all instances and having
       each instance delete it when finished isn't breaking anything.
    mbland committed Nov 25, 2023
    Configuration menu
    Copy the full SHA
    089386a View commit details
    Browse the repository at this point in the history
  3. Add hasContentType matcher, HTTP status consts

    This matcher removes a lot of boilerplate from checking the Content-Type
    of a HttpResponse. It's based on the Hamcrest API with the help of these
    tutorials:
    
    - https://hamcrest.org/JavaHamcrest/tutorial
    - https://www.baeldung.com/hamcrest-custom-matchers
    
    This could be generalized to handle any header.  However, I want to keep
    it straightforward for now, as a good basic example of how to write a
    custom matcher.
    
    Also took the opportunity to replace bare HTTP status codes (200, et.
    al.) with constants defined on jakarta.servlet.http.HttpServletResponse.
    mbland committed Nov 25, 2023
    Configuration menu
    Copy the full SHA
    2719139 View commit details
    Browse the repository at this point in the history