@@ -0,0 +1,2197 @@
+package oasis.web.resteasy;%0A%0Aimport static org.assertj.core.api.Assertions.*;%0A%0Aimport javax.ws.rs.GET;%0Aimport javax.ws.rs.Path;%0Aimport javax.ws.rs.core.Context;%0Aimport javax.ws.rs.core.MediaType;%0Aimport javax.ws.rs.core.Response;%0Aimport javax.ws.rs.core.UriBuilder;%0Aimport javax.ws.rs.core.UriInfo;%0A%0Aimport org.jboss.resteasy.spi.ResteasyUriInfo;%0Aimport org.jukito.JukitoRunner;%0Aimport org.junit.Before;%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0A%0Aimport com.google.inject.Inject;%0A%0Aimport oasis.http.testing.InProcessResteasy;%0A%0A/**%0A * Make we don't run in RESTEASY-1077 when upgrading Resteasy.%0A */%0A@RunWith(JukitoRunner.class)%0Apublic class Resteasy1077RegressionTest %7B%0A  @Inject @Rule public InProcessResteasy resteasy;%0A%0A  @Before%0A  public void setUp() %7B%0A    resteasy.getDeployment().getRegistry().addPerRequestResource(Resource.class);%0A  %7D%0A%0A  @Test%0A  public void testTrailingSlash() throws Exception %7B%0AResponse response = resteasy.getClient()%0A    .target(UriBuilder.fromPath(%22/test/%22))%0A    .request()%0A    .get();%0A%0A    assertThat(response.getStatusInfo()).isEqualTo(Response.Status.OK);%0A    assertThat(response.readEntity(String.class)).isEqualTo(%22test%22);%0A  %7D%0A%0A  @Test%0A  public void testNoTrailingSlash() throws Exception %7B%0A    Response response = resteasy.getClient()%0A        .target(UriBuilder.fromPath(%22/test%22))%0A        .request()%0A        .get();%0A%0A    assertThat(response.getStatusInfo()).isEqualTo(Response.Status.MOVED_PERMANENTLY);%0A    UriInfo location = new ResteasyUriInfo(response.getLocation());%0A    assertThat(location.getAbsolutePath()).isEqualTo(UriBuilder.fromUri(InProcessResteasy.BASE_URI).path(%22/test/%22).build());%0A  %7D%0A%0A  @Path(%22/%22)%0A  public static class Resource %7B%0A    @Path(%22/test/%22)%0A    @GET%0A    public Response test(@Context UriInfo uriInfo) %7B%0A          if (uriInfo.getPath().endsWith(%22/%22)) %7B%0A              return Response.ok(%22test%22, MediaType.TEXT_PLAIN_TYPE).build();%0A            %7D else %7B%0A              return Response%0A                          .status(Response.Status.MOVED_PERMANENTLY)%0A                        .location(uriInfo.getBaseUriBuilder().path(%22/test/%22).build())%0A                        .build();%0A            %7D%0A        %7D%0A  %7D%0A%7D%0A

Add test for RESTEASY-1077 to make sure we won't run into it later.