@Test
public void testQueryDocumentWithFactoryPath() throws Throwable {

    try {
        this.queryHelper.setFactoryPath(null);
        fail("IllegalArgumentException expected with null factoryPath.");
    } catch (IllegalArgumentException e) {
        // expected
    }
    this.minimalTestStates = queryDocumentWithFactoryPath("testLink");
    assertEquals(0, this.minimalTestStates.size());
    MinimalTestServiceState minimalTestState = new MinimalTestServiceState();
    minimalTestState.id = this.idValue1;
    minimalTestState = doPost(minimalTestState);
    this.minimalTestStates = queryDocumentWithFactoryPath(minimalTestState.documentSelfLink);
    assertEquals(1, this.minimalTestStates.size());
    assertEquals(minimalTestState.documentSelfLink,
            this.minimalTestStates.get(0).documentSelfLink);
    assertEquals(this.idValue1, this.minimalTestStates.get(0).id);
    delete(minimalTestState);
    this.minimalTestStates = queryDocumentWithFactoryPath(minimalTestState.documentSelfLink);
    assertEquals(0, this.minimalTestStates.size());
}