pw_tls_client: Align with new pw_stream

Use NonSeekableReaderWriter to replace ReaderWriter as base class for
various classes such as Session and TLS test server class.

Change-Id: Id7bc6835f8e8abe8559237326aab31d3f207dcae
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/57982
Reviewed-by: Wyatt Hepler <hepler@google.com>
Reviewed-by: Ali Zhang <alizhang@google.com>
Commit-Queue: Yecheng Zhao <zyecheng@google.com>
diff --git a/pw_tls_client/public/pw_tls_client/session.h b/pw_tls_client/public/pw_tls_client/session.h
index 14388b5..a84d133 100644
--- a/pw_tls_client/public/pw_tls_client/session.h
+++ b/pw_tls_client/public/pw_tls_client/session.h
@@ -27,7 +27,7 @@
 namespace pw::tls_client {
 
 // Session provides APIs for performing TLS communication.
-class Session : public stream::ReaderWriter {
+class Session : public stream::NonSeekableReaderWriter {
  public:
   // Resources allocated during Session::Create() will be released in the
   // destructor. For example, backend may choose to allocate Session from a pool
diff --git a/pw_tls_client/public/pw_tls_client/test/test_server.h b/pw_tls_client/public/pw_tls_client/test/test_server.h
index 9e8e5ff..b5dc299 100644
--- a/pw_tls_client/public/pw_tls_client/test/test_server.h
+++ b/pw_tls_client/public/pw_tls_client/test/test_server.h
@@ -25,7 +25,7 @@
 
 namespace pw::tls_client::test {
 
-class FixedSizeFIFOBuffer : public stream::ReaderWriter {
+class FixedSizeFIFOBuffer : public stream::NonSeekableReaderWriter {
  public:
   FixedSizeFIFOBuffer() = delete;
   FixedSizeFIFOBuffer(const FixedSizeFIFOBuffer&) = delete;
@@ -47,7 +47,7 @@
 // Reading from the server is equivalent to receiving data from the server.
 //
 // The server accepts is only for one client and echo messages it sends.
-class InMemoryTestServer : public stream::ReaderWriter {
+class InMemoryTestServer : public stream::NonSeekableReaderWriter {
  public:
   InMemoryTestServer() = delete;
   InMemoryTestServer(const InMemoryTestServer&) = delete;
diff --git a/pw_tls_client_mbedtls/tls_client_mbedtls_test.cc b/pw_tls_client_mbedtls/tls_client_mbedtls_test.cc
index 35e17e7..66242e8 100644
--- a/pw_tls_client_mbedtls/tls_client_mbedtls_test.cc
+++ b/pw_tls_client_mbedtls/tls_client_mbedtls_test.cc
@@ -13,25 +13,13 @@
 // the License.
 
 #include "gtest/gtest.h"
-#include "pw_stream/stream.h"
+#include "pw_stream/null_stream.h"
 #include "pw_tls_client/session.h"
 
-namespace {
-
-class NoopTransport : public pw::stream::ReaderWriter {
- private:
-  pw::StatusWithSize DoRead(pw::ByteSpan dest) { return pw::StatusWithSize(0); }
-
-  pw::Status DoWrite(pw::ConstByteSpan data) { return pw::OkStatus(); }
-};
-
-}  // namespace
-
 namespace pw::tls_client {
 
 TEST(TLSClientMbedTLS, CreateSucceed) {
-  NoopTransport transport;
-  auto options = SessionOptions().set_transport(transport);
+  auto options = SessionOptions().set_transport(stream::NullStream::Instance());
   auto res = Session::Create(options);
   ASSERT_EQ(res.status(), OkStatus());
   ASSERT_NE(res.value(), nullptr);
@@ -45,8 +33,7 @@
 
 TEST(TLSClientMbedTLS, EntropySourceFail) {
   backend::SessionImplementation::SetEntropySourceStatus(Status::Internal());
-  NoopTransport transport;
-  auto options = SessionOptions().set_transport(transport);
+  auto options = SessionOptions().set_transport(stream::NullStream::Instance());
   auto res = Session::Create(options);
   ASSERT_NE(res.status(), OkStatus());
 }