Skip to content

Commit c49936f

Browse files
author
eugenp
committed
work on integration testing
1 parent 820adef commit c49936f

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

‎src/main/java/org/rest/web/controller/discovery/DiscoverabilityController.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ final class DiscoverabilityController{
2525
public final void adminRoot( final HttpServletRequest request, final HttpServletResponse response ){
2626
final String rootUri = request.getRequestURL().toString();
2727

28-
final URI uri = new UriTemplate( "{rootUri}/{resource}" ).expand( rootUri, "user" );
28+
// TODO: add these in a more dynamic way, not hardcoded
29+
final URI uri = new UriTemplate( "{rootUri}{resource}" ).expand( rootUri, "user" );
2930
final String linkToEntity = RESTURIUtil.createLinkHeader( uri.toASCIIString(), RESTURIUtil.REL_COLLECTION );
3031
final String linkToTest = RESTURIUtil.createLinkHeader( "test", RESTURIUtil.REL_COLLECTION );
3132

‎src/test/java/org/rest/testing/ExamplePaths.java‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@ public final class ExamplePaths{
1212
// API
1313

1414
public final String getRootUri(){
15-
return paths.getContext() + "/api";
15+
return paths.getContext() + "/api/";
1616
}
1717

1818
public final String getUserUri(){
19-
return getRootUri() + "/user";
19+
return getRootUri() + "user";
2020
}
2121
public final String getPrivilegeUri(){
22-
return getRootUri() + "/privilege";
22+
return getRootUri() + "privilege";
2323
}
2424
public final String getRoleUri(){
25-
return getRootUri() + "/role";
25+
return getRootUri() + "role";
2626
}
2727

2828
public final String getAuthenticationUri(){
29-
return getRootUri() + "/authentication";
29+
return getRootUri() + "authentication";
3030
}
3131

3232
public final String getLoginUri(){

‎src/test/java/org/rest/web/common/AbstractDiscoverabilityRESTIntegrationTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public final void whenResourceIsRetrieved_thenURIToGetAllResourcesIsDiscoverable
7272
final String uriToAllResources = HTTPLinkHeaderUtils.extractURIByRel( getResponse.getHeader( HttpHeaders.LINK ), RESTURIUtil.REL_COLLECTION );
7373

7474
final Response getAllResponse = this.getTemplate().getResourceAsResponse( uriToAllResources );
75-
assertThat( getAllResponse.getStatusCode(), is( 303 ) );
75+
assertThat( getAllResponse.getStatusCode(), is( 200 ) );
7676
}
7777

7878
// GET (paged)

0 commit comments

Comments
 (0)