use of java.net.http.HttpRequest.BodyPublisher in project jena by apache.
the class TestWebappServerReadOnly method gsp_w_readonly_POST.
@Test
public void gsp_w_readonly_POST() {
// Try to write
HttpTest.execWithHttpException(HttpSC.METHOD_NOT_ALLOWED_405, () -> {
BodyPublisher bodyPublisher = BodyPublishers.ofString("");
HttpOp.httpPost(ServerCtl.serviceGSP() + "?default", null, bodyPublisher);
});
}
use of java.net.http.HttpRequest.BodyPublisher in project jena by apache.
the class TestWebappServerReadOnly method dataset_w_readonly_PUT.
@Test
public void dataset_w_readonly_PUT() {
// Try to write
HttpTest.execWithHttpException(HttpSC.METHOD_NOT_ALLOWED_405, () -> {
BodyPublisher bodyPublisher = BodyPublishers.ofString("");
HttpOp.httpPut(ServerCtl.urlDataset(), null, bodyPublisher);
});
}
use of java.net.http.HttpRequest.BodyPublisher in project jena by apache.
the class TestWebappServerReadOnly method gsp_w_readonly_PUT.
@Test
public void gsp_w_readonly_PUT() {
// Try to write
HttpTest.execWithHttpException(HttpSC.METHOD_NOT_ALLOWED_405, () -> {
BodyPublisher bodyPublisher = BodyPublishers.ofString("");
HttpOp.httpPut(ServerCtl.serviceGSP() + "?default", null, bodyPublisher);
});
}
use of java.net.http.HttpRequest.BodyPublisher in project jena by apache.
the class TestWebappServerReadOnly method dataset_w_readonly_POST.
@Test
public void dataset_w_readonly_POST() {
// Try to write
HttpTest.execWithHttpException(HttpSC.METHOD_NOT_ALLOWED_405, () -> {
BodyPublisher bodyPublisher = BodyPublishers.ofString("");
HttpOp.httpPost(ServerCtl.urlDataset(), null, bodyPublisher);
});
}
use of java.net.http.HttpRequest.BodyPublisher in project jena by apache.
the class TestAdmin method addTestDataset.
private static void addTestDataset(String filename) {
try {
Path f = Path.of(filename);
BodyPublisher body = BodyPublishers.ofFile(f);
String ct = WebContent.contentTypeTurtle;
httpPost(ServerCtl.urlRoot() + "$/" + opDatasets, ct, body);
} catch (FileNotFoundException e) {
IO.exception(e);
}
}
Aggregations