@Test
public void testFindDeprecatedDocumentUniqueIds() throws Throwable {

	// Arrange
	String submissionSetPatientIdMock = "submissionSetPatientIdMock";
	String submissionSetAuthorPersonMock = "submissionSetAuthorPersonMock";
	AdhocQueryRequest findSubmissionSetsRequestMock = mock(AdhocQueryRequest.class);
	AdhocQueryResponse findSubmissionSetsResponseMock = mock(AdhocQueryResponse.class);
	AdhocQueryRequest getSubmissionSetAndContentsRequestMock = mock(AdhocQueryRequest.class);
	AdhocQueryResponse getSubmissionSetAndContentsResponseMock = mock(AdhocQueryResponse.class);
	List<String> extractSubmissionSetUniqueIdsMock = new LinkedList<String>();
	String extractSubmissionSetUniqueIdMock = "extractSubmissionSetUniqueIdMock";
	extractSubmissionSetUniqueIdsMock.add(extractSubmissionSetUniqueIdMock);
	String deprecatedDocumentUniqueIdMock = "deprecatedDocumentUniqueIdMock";
	when(
			xdsbRegistryAdapterSpy.createFindSubmissionSetsRequest(
					submissionSetPatientIdMock,
					submissionSetAuthorPersonMock)).thenReturn(
			findSubmissionSetsRequestMock);
	when(
			xdsbRegistryMock
					.registryStoredQuery(findSubmissionSetsRequestMock))
			.thenReturn(findSubmissionSetsResponseMock);
	doReturn(extractSubmissionSetUniqueIdsMock)
			.when(xdsbRegistryAdapterSpy).extractSubmissionSetUniqueIds(
					findSubmissionSetsResponseMock);
	when(
			xdsbRegistryAdapterSpy
					.createGetSubmissionSetAndContentsRequest(extractSubmissionSetUniqueIdMock, ""))
			.thenReturn(getSubmissionSetAndContentsRequestMock);
	when(
			xdsbRegistryMock
					.registryStoredQuery(getSubmissionSetAndContentsRequestMock))
			.thenReturn(getSubmissionSetAndContentsResponseMock);
	doReturn(deprecatedDocumentUniqueIdMock).when(xdsbRegistryAdapterSpy)
			.extractDeprecatedDocumentUniqueId(
					getSubmissionSetAndContentsResponseMock, "");
	// Act
	List<String> result = xdsbRegistryAdapterSpy
			.findDeprecatedDocumentUniqueIds(submissionSetPatientIdMock,
					submissionSetAuthorPersonMock, "");
	// Assert
	assertTrue(result.contains(deprecatedDocumentUniqueIdMock));
}