CoreTokenLDAPAdapterTest.java revision b334b83b7ac2d9a8c60d935cad0365506f13333b
/**
* Copyright 2013 ForgeRock, AS.
*
* 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]".
*/
/**
* @author robert.wapshott@forgerock.com
*/
public class CoreTokenLDAPAdapterTest {
private Connection mockConnection;
private DataLayerConnectionFactory mockFactory;
private CoreTokenConstants constants;
private LDAPDataConversion dataConversion;
public void setup() {
try {
} catch (ErrorResultException e) {
throw new IllegalStateException(e);
}
dataConversion = new LDAPDataConversion();
}
@Test
// Given
new QueryFactory(),
// Ensure the Connection add is a success
// When
// Then
}
@Test
public void shouldGenerateAnInstanceOfQueryBuilder() throws ErrorResultException {
// Given
// When
// Then
}
public void shouldFailIfMultipleTokensFoundWhilstUpdating() throws CoreTokenException, ErrorResultException {
// Given
// When / Then
}
@Test
public void shouldCreateTokenIfNotPresentWhilstUpdating() throws CoreTokenException, ErrorResultException {
// Given
// Ensure the Connection add is a success
// When
// Then
}
@Test
// Given
// Ensure the Connection add is a success
// When
// Then
}
@Test
// Given
new QueryFactory(),
// Ensure the delete operation is a success
// Ensure conversion via TokenAttributeConversion is successful
// When
// Then
}
@Test
// Given
new QueryFactory(),
// Ensure the connection returns something useful
// Ensure we generate a suitable token from the SearchResultEntry conversion.
// When
// Then
}
public void shouldFailReadIfOtherExceptionIsEncountered() throws CoreTokenException, ErrorResultException {
// Given
new QueryFactory(),
// When / Then
}
@Test
public void shouldReturnNullIfNoTokenFoundWhenRead() throws ErrorResultException, CoreTokenException {
// Given
new QueryFactory(),
ErrorResultException exception = ErrorResultException.newErrorResult(ResultCode.NO_SUCH_OBJECT, "test");
// When
// Then
}
any(DataLayerConnectionFactory.class),
any(CoreTokenConstants.class)))
Entry e = new LinkedHashMapEntry();
}
return factory;
}
private Result successResult() {
return result;
}
}