RESTEndpointTest.java revision bbe59b9e7b19daeef0e63ffa77aaefb67aceb85e
/*
* 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 2016 ForgeRock AS.
*/
/**
* Test the RESTEndpoint class.
*/
public class RESTEndpointTest {
@Test
public void shouldTestSimplePath() {
.build();
}
@Test
public void shouldAppendTwoPaths() {
.build();
}
@Test
public void shouldAppendTwoPathsWithExtraSeparators() {
.build();
}
@Test
public void shouldAppendThreePathsWithExtraSeparators() {
.build();
}
@Test
public void shouldHandleMultipleParametersInCorrectOrder() {
.path("<path>")
.path("<append>")
.build();
// Ordering should be preserved with the parameters, even though it probably doesn't make a difference
// in real life.
}
/**
* Note that this actually checks the output of the toString function, which could be made to lie without effecting
* the remainder of the functionality within the class. However, using toString means we don't have to introduce
* any other functions to access the http method.
*/
@Test
public void checkGetAndPost() {
// Check the default is POST
.get()
.build();
.post()
.build();
}
@Test
public void checkToStringHidesPasswordsInPostData() {
.build();
// Check there is no post data
.build();
postData = "Password: secret";
.build();
}
@Test
public void checkHeaders() {
.build();
}
@Test
public void shouldHidePasswordsInHeaders() {
.build();
}
}