<commit_before>package com.rewedigital.examples.msintegration.composer.proxy;

import static java.util.Collections.singletonList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionStage;
import java.util.concurrent.ExecutionException;

import org.junit.Test;

import com.rewedigital.examples.msintegration.composer.composing.Composer;
import com.rewedigital.examples.msintegration.composer.routing.BackendRouting;
import com.rewedigital.examples.msintegration.composer.routing.BackendRouting.RouteMatch;
import com.rewedigital.examples.msintegration.composer.routing.StaticBackendRoutes.Match;
import com.spotify.apollo.Environment;
import com.spotify.apollo.Request;
import com.spotify.apollo.RequestContext;
import com.spotify.apollo.Response;
import com.spotify.apollo.Status;
import com.spotify.apollo.route.Rule;
import com.spotify.apollo.route.RuleRouter;

import okio.ByteString;

public class ComposingHandlerTest {

    private static final String SERVICE_RESPONSE = "<html>test</html>";

    @Test
    public void happyPathSuccess() throws InterruptedException, ExecutionException {
        final ComposingRequestHandler handler = new ComposingRequestHandler(new BackendRouting(aRouter()), new StubTemplateClient(),
            new Composer(mock(Environment.class)));

        final Response<String> response = handler.execute(aContext()).toCompletableFuture().get();

        assertThat(response.payload().get()).isEqualTo(SERVICE_RESPONSE);
    }

    private RuleRouter<Match> aRouter() {
        final Rule<Match> sampleRule = Rule.fromUri("/<path:path>", "GET", Match.of("http://target"));
        return RuleRouter.of(singletonList(sampleRule));
    }<commit_msg>fixed compile error in test<commit_after>package com.rewedigital.examples.msintegration.composer.proxy;

import static java.util.Collections.singletonList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionStage;
import java.util.concurrent.ExecutionException;

import org.junit.Test;

import com.rewedigital.examples.msintegration.composer.composing.Composer;
import com.rewedigital.examples.msintegration.composer.routing.BackendRouting;
import com.rewedigital.examples.msintegration.composer.routing.BackendRouting.RouteMatch;
import com.rewedigital.examples.msintegration.composer.routing.StaticBackendRoutes.Match;
import com.rewedigital.examples.msintegration.composer.routing.StaticBackendRoutes.RouteType;
import com.spotify.apollo.Environment;
import com.spotify.apollo.Request;
import com.spotify.apollo.RequestContext;
import com.spotify.apollo.Response;
import com.spotify.apollo.Status;
import com.spotify.apollo.route.Rule;
import com.spotify.apollo.route.RuleRouter;

import okio.ByteString;

public class ComposingHandlerTest {

    private static final String SERVICE_RESPONSE = "<html>test</html>";

    @Test
    public void happyPathSuccess() throws InterruptedException, ExecutionException {
        final ComposingRequestHandler handler = new ComposingRequestHandler(new BackendRouting(aRouter()), new StubTemplateClient(),
            new Composer(mock(Environment.class)));

        final Response<String> response = handler.execute(aContext()).toCompletableFuture().get();

        assertThat(response.payload().get()).isEqualTo(SERVICE_RESPONSE);
    }

    private RuleRouter<Match> aRouter() {
        final Rule<Match> sampleRule = Rule.fromUri("/<path:path>", "GET", Match.of("http://target", RouteType.TEMPLATE));
        return RuleRouter.of(singletonList(sampleRule));
    }
{'fraction_non_alphanumeric': 0.10751028806584362, 'fraction_numerical': 0.0, 'mean_word_length': 5.728373702422146, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '836207', 'n_tokens_mistral': 1137, 'n_tokens_neox': 1129, 'n_words': 187}