alef 0.103.6

Opinionated polyglot binding generator for Rust libraries
Documentation
{#- Once-per-suite mock-request-count helper (alef issue #443).

   Context variables (see src/e2e/codegen/mock_assertions/helper.rs for the full contract):
   - helper_name: method name
   - total_path: mock server's total-count endpoint path
   - one_path: mock server's single-key endpoint path

   Emits ONE private static method using fully-qualified `java.net.http` types, matching this
   backend's existing `http_request.jinja` idiom of never importing them (see `test_file.rs`'s
   own import list, which has no `java.net.http.*` entry despite HTTP test methods using it) --
   so this helper adds no new import to gate on either. Callers build `pathAndQuery` from
   "{{ total_path }}?prefix=<p>" (mock.requests.total) or "{{ one_path }}?key=<k>"
   (mock.requests["<k>"]) -- see mock_assertions::model::MockQuery.
#}

    private static int {{ helper_name }}(String baseUrl, String pathAndQuery) {
        try {
            var request = java.net.http.HttpRequest.newBuilder(java.net.URI.create(baseUrl + pathAndQuery))
                .GET()
                .build();
            var response = java.net.http.HttpClient.newHttpClient()
                .send(request, java.net.http.HttpResponse.BodyHandlers.ofString());
            return Integer.parseInt(response.body().trim());
        } catch (Exception e) {
            throw new RuntimeException("{{ helper_name }}: request failed: " + e.getMessage(), e);
        }
    }