final CheckedFuture<Void, TransactionCommitFailedException> future = submitData(
transactionNode.getTransactionChain(), transactionNode.getTransactionChain().newReadWriteTransaction(),
transactionNode.getInstanceIdentifier().getInstanceIdentifier());
- final ResponseFactory response = new ResponseFactory(Status.OK);
+ final ResponseFactory response = new ResponseFactory(Status.NO_CONTENT);
FutureCallbackTx.addCallback(future, RestconfDataServiceConstant.DeleteData.DELETE_TX_TYPE, response);
return response.build();
}
final FutureDataFactory<Boolean> existsResponse = new FutureDataFactory<>();
FutureCallbackTx.addCallback(existsFuture, RestconfDataServiceConstant.PutData.PUT_TX_TYPE, existsResponse);
- final ResponseFactory responseFactory = new ResponseFactory(existsResponse.result ? Status.OK : Status.CREATED);
+ final ResponseFactory responseFactory =
+ new ResponseFactory(existsResponse.result ? Status.NO_CONTENT : Status.CREATED);
final CheckedFuture<Void, TransactionCommitFailedException> submitData = submitData(path, schemaContext,
transactionNode.getTransactionChain(), readWriteTransaction, payload.getData(), insert, point);
FutureCallbackTx.addCallback(submitData, RestconfDataServiceConstant.PutData.PUT_TX_TYPE, responseFactory);
doReturn(Futures.immediateCheckedFuture(null)).when(this.readWrite).submit();
final Response response = this.dataService.putData(null, payload, this.uriInfo);
assertNotNull(response);
- assertEquals(200, response.getStatus());
+ assertEquals(Response.Status.NO_CONTENT.getStatusCode(), response.getStatus());
}
@Test
doReturn(Futures.immediateCheckedFuture(null)).when(this.readWrite).submit();
final Response response = this.dataService.putData(null, payload, this.uriInfo);
assertNotNull(response);
- assertEquals(200, response.getStatus());
+ assertEquals(Response.Status.NO_CONTENT.getStatusCode(), response.getStatus());
}
@Test
.when(this.readWrite).exists(LogicalDatastoreType.CONFIGURATION, this.iidBase);
final Response response = this.dataService.deleteData("example-jukebox:jukebox");
assertNotNull(response);
- assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
+ assertEquals(Response.Status.NO_CONTENT.getStatusCode(), response.getStatus());
}
/**
final Response response =
this.dataService.deleteData("example-jukebox:jukebox/yang-ext:mount/example-jukebox:jukebox");
assertNotNull(response);
- assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
+ assertEquals(Response.Status.NO_CONTENT.getStatusCode(), response.getStatus());
}
@Test
new TransactionVarsWrapper(this.context, null, this.transactionChain));
// assert success
- assertEquals("Not expected response received", Status.OK.getStatusCode(), response.getStatus());
+ assertEquals("Not expected response received", Status.NO_CONTENT.getStatusCode(), response.getStatus());
}
/**
assertEquals(404, e.getErrors().get(0).getErrorTag().getStatusCode());
}
}
-}
\ No newline at end of file
+}