@Test
public void testOwner() throws Exception {
deployModule("module1", TestModule1.class);
HttpResponse response = createInstance(NamespaceId.DEFAULT.dataset("ownedDataset"), "datasetType1", null,
DatasetProperties.EMPTY, "alice/bob/somehost.net@somekdc.net");
Assert.assertEquals(HttpStatus.SC_BAD_REQUEST, response.getResponseCode());
String alicePrincipal = "alice/somehost.net@somekdc.net";
response = createInstance(NamespaceId.DEFAULT.dataset("ownedDataset"), "datasetType1", null,
DatasetProperties.EMPTY,
alicePrincipal);
Assert.assertEquals(HttpStatus.SC_OK, response.getResponseCode());
Assert.assertEquals(alicePrincipal, ownerAdmin.getOwnerPrincipal(NamespaceId.DEFAULT.dataset("ownedDataset")));
DatasetMeta meta = getInstanceObject("ownedDataset").getResponseObject();
Assert.assertEquals(alicePrincipal, meta.getOwnerPrincipal());
response = deleteInstance(NamespaceId.DEFAULT.dataset("ownedDataset"));
Assert.assertEquals(HttpStatus.SC_OK, response.getResponseCode());
Assert.assertNull(ownerAdmin.getOwner(NamespaceId.DEFAULT.dataset("ownedDataset")));
}