OathDevicesResourceTest.java revision 16682c615640da7d54591f86528a5eb562e0ab97
/*
* 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 2015 ForgeRock AS.
*/
public class OathDevicesResourceTest {
private OathDevicesResource resource;
@Mock
private OathDevicesDao dao;
@Mock
private ContextHelper contextHelper;
@Mock
private ContextHelper context;
@Mock
@Mock
@Mock
private AuthenticatorOathService oathService;
MockitoAnnotations.initMocks(this);
}
}
@Test
// Given
devices.add(json(object(field("name", "NAME_1"), field("lastSelectedDate", new Date().getTime()))));
devices.add(json(object(field("name", "NAME_2"), field("lastSelectedDate", new Date().getTime() + 1000))));
// When
Promise<QueryResponse, ResourceException> actual = resource.queryCollection(ctx(), request, handler);
// Then
}
/**
* Tests the OathDeveResources deleteInstance() method.
*
* @throws ResourceException
* @throws SSOException
* @throws ExecutionException
* @throws InterruptedException
*/
@Test
public void shouldDeleteTrustedDevice()
// GIVEN
// WHEN
Promise<ResourceResponse, ResourceException> actual = resource.deleteInstance(ctx(), request.getResourcePath(),
request);
// THEN
}
@Test
// Given
// When
Promise<ResourceResponse, ResourceException> promise = resource.deleteInstance(ctx(), request.getResourcePath(),
request);
// Then
}
@Test
// given
// when
// then
}
@Test
public void shouldExecuteSkipAction()
// given
// when
// then
}
@Test
public void shouldExecuteTrueCheckAction()
// give
// when
// then
}
@Test
// given
// when
Promise<ActionResponse, ResourceException> promise = resource.actionInstance(ctx(), "", actionRequest);
// then
}
private static class OathDevicesResourceTestClass extends OathDevicesResource {
}
try {
} catch (IdRepoException | SSOException e) {
e.printStackTrace();
}
return mockId;
}
}
}