PostgresDatabase extends AbstractDatabase { @Override public String insertResponse(String id, InputStream inputStream) { WpsResponse wpsResponse = new WpsResponse(id, inputStream); wpsResponse.setStartTime(new DateTime()); insertWpsResponse(wpsResponse); return generateRetrieveResultURL(id); } private  PostgresDatabase(); static synchronized PostgresDatabase getInstance(); @Override String getConnectionURL(); @Override Connection getConnection(); @Override String generateRetrieveResultURL(String id); @Override void insertRequest(String id, InputStream inputStream, boolean xml); @Override String insertResponse(String id, InputStream inputStream); @Override synchronized String storeComplexValue(String requestid, String outputIdentifier, InputStream stream, String type, String mimeType); @Override void updateResponse(String id, InputStream stream); @Override InputStream lookupResponse(String id); @Override String getMimeTypeForStoreResponse(String id); @Override long getContentLengthForStoreResponse(String id); @Override File lookupResponseAsFile(String id);  }
@Test @Ignore public void testInsertResponse() throws Exception { PostgresDatabase.getInstance().insertResponse("test", PostgresDatabaseTest.class.getClassLoader().getResourceAsStream("succeeded.xml")); Connection conn = ds.getConnection(); final Statement statement = conn.createStatement(); assertThat(statement.execute("SELECT * FROM RESPONSE;"), is(true)); assertThat(statement.getResultSet().next(), is(true)); assertThat(statement.getResultSet().getString("REQUEST_ID"), is("test")); }