// Path: fedora-client-core/src/main/java/com/yourmediashelf/fedora/client/FedoraClient.java
// public static RiSearch riSearch(String query) {
//     return new RiSearch(query);
// }
// 
// Path: fedora-client-core/src/main/java/com/yourmediashelf/fedora/client/FedoraClientException.java
// public class FedoraClientException extends Exception {
// 
//     private static final long serialVersionUID = 1L;
// 
//     private int status;
// 
//     public FedoraClientException(String message) {
//         super(message, null);
//     }
// 
//     public FedoraClientException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     /**
//      *
//      * @param status the HTTP status code of the error.
//      * @param message
//      */
//     public FedoraClientException(int status, String message) {
//         super(message);
//         this.status = status;
//     }
// 
//     /**
//      *
//      * @return the HTTP status code of the error
//      */
//     public int getStatus() {
//         return status;
//     }
// }
// 
// Path: fedora-client-core/src/main/java/com/yourmediashelf/fedora/client/response/RiSearchResponse.java
// public class RiSearchResponse extends FedoraResponseImpl {
// 
//     public RiSearchResponse(ClientResponse cr)
//             throws FedoraClientException {
//         super(cr);
//     }
// }


import static com.yourmediashelf.fedora.client.FedoraClient.riSearch;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import com.yourmediashelf.fedora.client.FedoraClientException;
import com.yourmediashelf.fedora.client.response.RiSearchResponse;
        String pidUri = "info:fedora/" + getTestPid();
        String query =
                String.format("select ?s from <#ri> "
                        + "where {?s <fedora-model:hasModel> ?o . "
                        + "FILTER(STR(?s) = \"%s\")}", pidUri);

        RiSearchResponse response = null;
        response = riSearch(query).flush(true).execute();
        assertEquals(200, response.getStatus());
        String result = response.getEntity(String.class);
        assertTrue(result.contains(getTestPid()));
    }

    @Test
    public void testSPO() throws Exception {
        String pidUri = "info:fedora/" + getTestPid();
        String query = String.format("<%s> <fedora-model:hasModel> *", pidUri);

        RiSearchResponse response = null;

        response =
                riSearch(query).lang("spo").type("triples").flush(true)
                        .execute();
        assertEquals(200, response.getStatus());
        String result = response.getEntity(String.class);
        assertTrue(result.contains(getTestPid()));
    }

    @Override
    public void testNoDefaultClientRequest() throws FedoraClientException {
// Path: fedora-client-core/src/main/java/com/yourmediashelf/fedora/client/FedoraClient.java
// public static RiSearch riSearch(String query) {
//     return new RiSearch(query);
// }
// 
// Path: fedora-client-core/src/main/java/com/yourmediashelf/fedora/client/FedoraClientException.java
// public class FedoraClientException extends Exception {
// 
//     private static final long serialVersionUID = 1L;
// 
//     private int status;
// 
//     public FedoraClientException(String message) {
//         super(message, null);
//     }
// 
//     public FedoraClientException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     /**
//      *
//      * @param status the HTTP status code of the error.
//      * @param message
//      */
//     public FedoraClientException(int status, String message) {
//         super(message);
//         this.status = status;
//     }
// 
//     /**
//      *
//      * @return the HTTP status code of the error
//      */
//     public int getStatus() {
//         return status;
//     }
// }
// 
// Path: fedora-client-core/src/main/java/com/yourmediashelf/fedora/client/response/RiSearchResponse.java
// public class RiSearchResponse extends FedoraResponseImpl {
// 
//     public RiSearchResponse(ClientResponse cr)
//             throws FedoraClientException {
//         super(cr);
//     }
// }


// Path: fedora-client-core/src/test/java/com/yourmediashelf/fedora/client/request/RiSearchIT.java
import static com.yourmediashelf.fedora.client.FedoraClient.riSearch;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import com.yourmediashelf.fedora.client.FedoraClientException;
import com.yourmediashelf.fedora.client.response.RiSearchResponse;

        String pidUri = "info:fedora/" + getTestPid();
        String query =
                String.format("select ?s from <#ri> "
                        + "where {?s <fedora-model:hasModel> ?o . "
                        + "FILTER(STR(?s) = \"%s\")}", pidUri);

        RiSearchResponse response = null;
        response = riSearch(query).flush(true).execute();
        assertEquals(200, response.getStatus());
        String result = response.getEntity(String.class);
        assertTrue(result.contains(getTestPid()));
    }

    @Test
    public void testSPO() throws Exception {
        String pidUri = "info:fedora/" + getTestPid();
        String query = String.format("<%s> <fedora-model:hasModel> *", pidUri);

        RiSearchResponse response = null;

        response =
                riSearch(query).lang("spo").type("triples").flush(true)
                        .execute();
        assertEquals(200, response.getStatus());
        String result = response.getEntity(String.class);
        assertTrue(result.contains(getTestPid()));
    }

    @Override
    public void testNoDefaultClientRequest() throws FedoraClientException {
        testNoDefaultClientRequest(riSearch("* * *").lang("spo")