CrestRealmRouterTest.java revision 0cfee6a97b10cafb2fe04fc97438103d3ab1159b
/*
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2014 ForgeRock AS.
*/
public class CrestRealmRouterTest {
private RestRealmValidator realmValidator;
private CoreWrapper coreWrapper;
private CrestRealmRouter router;
private CollectionResourceProvider usersProvider;
private CollectionResourceProvider groupsProvider;
private void setUpClass() {
}
public void setUp() {
}
private Object[][] dataProvider() {
return new Object[][]{
};
}
public void shouldRouteToRealmWithDynamicURIRealm(String uriRealm, String resource, String resourceName,
//Given
//When
//Then
}
private Object[][] realmRoutingDataProvider() {
return new Object[][]{
{"openam.example.com", "", "/realm", "/realm"},
{"openam.example.com", "", "/realmAlias", "/realm"},
};
}
public void shouldRouteToRealm(String hostname, String uriRealm, String queryRealm, String expectedRealm)
throws Exception {
//Given
//When
//Then
verify(mockResource).readInstance(contextCaptor.capture(), eq("demo"), Matchers.<ReadRequest>anyObject(),
}
}
private HttpServletRequest setUpRequest(String hostname, String uriRealm, String queryRealm, String resource) {
if (queryRealm != null) {
}
given(request.getRequestURL()).willReturn(new StringBuffer("http://" + hostname + ":8080/openam/json"
if (queryRealm != null) {
}
return request;
}
return response;
}
}
}
return new CollectionResourceProvider() {
}
}
public void createInstance(ServerContext context, CreateRequest request, ResultHandler<Resource> handler) {
}
}
}
public void queryCollection(ServerContext context, QueryRequest request, QueryResultHandler handler) {
}
}
}
};
}
}