diff --git a/afrouter/afrouter/round-robin-router_test.go b/afrouter/afrouter/round-robin-router_test.go
new file mode 100644
index 0000000..4d92e45
--- /dev/null
+++ b/afrouter/afrouter/round-robin-router_test.go
@@ -0,0 +1,289 @@
+/*
+ * Portions copyright 2019-present Open Networking Foundation
+ * Original copyright 2019-present Ciena Corporation
+ *
+ * Licensed under the Apache License, Version 2.0 (the"github.com/stretchr/testify/assert" "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package afrouter
+
+import (
+	"fmt"
+	"github.com/golang/protobuf/proto"
+	"github.com/opencord/voltha-go/common/log"
+	common_pb "github.com/opencord/voltha-protos/go/common"
+	"github.com/stretchr/testify/assert"
+	"google.golang.org/grpc"
+	"testing"
+)
+
+const (
+	ROUND_ROBIN_ROUTER_PROTOFILE = "../../vendor/github.com/opencord/voltha-protos/go/voltha.pb"
+)
+
+func init() {
+	log.SetDefaultLogger(log.JSON, log.DebugLevel, nil)
+	log.AddPackage(log.JSON, log.WarnLevel, nil)
+}
+
+func MakeRoundRobinTestConfig(numBackends int, numConnections int) (*RouteConfig, *RouterConfig) {
+
+	var backends []BackendConfig
+	for backendIndex := 0; backendIndex < numBackends; backendIndex++ {
+		var connections []ConnectionConfig
+		for connectionIndex := 0; connectionIndex < numConnections; connectionIndex++ {
+			connectionConfig := ConnectionConfig{
+				Name: fmt.Sprintf("ro_vcore%d%d", backendIndex, connectionIndex+1),
+				Addr: "foo",
+				Port: "123",
+			}
+			connections = append(connections, connectionConfig)
+		}
+
+		backendConfig := BackendConfig{
+			Name:        fmt.Sprintf("ro_vcore%d", backendIndex),
+			Type:        BackendSingleServer,
+			Connections: connections,
+		}
+
+		backends = append(backends, backendConfig)
+	}
+
+	backendClusterConfig := BackendClusterConfig{
+		Name:     "ro_vcore",
+		Backends: backends,
+	}
+
+	routeConfig := RouteConfig{
+		Name:           "read_only",
+		Type:           RouteTypeRoundRobin,
+		Association:    AssociationRoundRobin,
+		BackendCluster: "ro_vcore",
+		backendCluster: &backendClusterConfig,
+		Methods:        []string{"ListDevicePorts"},
+	}
+
+	routerConfig := RouterConfig{
+		Name:         "vcore",
+		ProtoService: "VolthaService",
+		ProtoPackage: "voltha",
+		Routes:       []RouteConfig{routeConfig},
+		ProtoFile:    ROUND_ROBIN_ROUTER_PROTOFILE,
+	}
+	return &routeConfig, &routerConfig
+}
+
+// Route() requires an open connection, so pretend we have one.
+func PretendRoundRobinOpenConnection(router Router, clusterName string, backendIndex int, connectionName string) {
+	cluster := router.FindBackendCluster(clusterName)
+
+	// Route Method expects an open connection
+	conn := cluster.backends[backendIndex].connections[connectionName]
+	cluster.backends[backendIndex].openConns[conn] = &grpc.ClientConn{}
+}
+
+// Common setup to run before each unit test
+func RoundRobinTestSetup() {
+	// reset globals that need to be clean for each unit test
+
+	clusters = make(map[string]*cluster)
+}
+
+// Test creation of a new RoundRobinRouter, and the Service(), Name(), FindBackendCluster(), and
+// ReplyHandler() methods.
+func TestRoundRobinRouterInit(t *testing.T) {
+	RoundRobinTestSetup()
+
+	routeConfig, routerConfig := MakeRoundRobinTestConfig(1, 1)
+
+	router, err := newRoundRobinRouter(routerConfig, routeConfig)
+
+	assert.NotNil(t, router)
+	assert.Nil(t, err)
+
+	assert.Equal(t, router.Service(), "VolthaService")
+	assert.Equal(t, router.Name(), "read_only")
+
+	cluster, err := router.BackendCluster("foo", "bar")
+	assert.Equal(t, cluster, clusters["ro_vcore"])
+	assert.Nil(t, err)
+
+	assert.Equal(t, router.FindBackendCluster("ro_vcore"), clusters["ro_vcore"])
+	assert.Nil(t, router.ReplyHandler("foo"))
+}
+
+func TestRoundRobinRouterInitNoName(t *testing.T) {
+	RoundRobinTestSetup()
+
+	routeConfig, routerConfig := MakeRoundRobinTestConfig(1, 1)
+	routeConfig.Name = ""
+
+	_, err := newRoundRobinRouter(routerConfig, routeConfig)
+
+	assert.EqualError(t, err, "Failed to create a new router ''")
+}
+
+func TestRoundRobinRouterInitNoProtoPackage(t *testing.T) {
+	RoundRobinTestSetup()
+
+	routeConfig, routerConfig := MakeRoundRobinTestConfig(1, 1)
+	routerConfig.ProtoPackage = ""
+
+	_, err := newRoundRobinRouter(routerConfig, routeConfig)
+
+	assert.EqualError(t, err, "Failed to create a new router 'read_only'")
+}
+
+func TestRoundRobinRouterInitNoProtoService(t *testing.T) {
+	RoundRobinTestSetup()
+
+	routeConfig, routerConfig := MakeRoundRobinTestConfig(1, 1)
+	routerConfig.ProtoService = ""
+
+	_, err := newRoundRobinRouter(routerConfig, routeConfig)
+
+	assert.EqualError(t, err, "Failed to create a new router 'read_only'")
+}
+
+// Tests a cluster with no backends
+func TestRoundRobinRouteZero(t *testing.T) {
+	RoundRobinTestSetup()
+
+	routeConfig, routerConfig := MakeRoundRobinTestConfig(1, 1)
+
+	router, err := newRoundRobinRouter(routerConfig, routeConfig)
+	assert.Nil(t, err)
+
+	idMessage := &common_pb.ID{Id: "1234"}
+
+	idData, err := proto.Marshal(idMessage)
+	assert.Nil(t, err)
+
+	sel := &requestFrame{payload: idData,
+		err:        nil,
+		methodInfo: newMethodDetails("/voltha.VolthaService/ListDevicePorts")}
+
+	backend, connection := router.Route(sel)
+
+	assert.EqualError(t, sel.err, "No backend with open connections found")
+	assert.Nil(t, backend)
+	assert.Nil(t, connection)
+}
+
+// Tests a cluster with only one Backend
+func TestRoundRobinRouteOne(t *testing.T) {
+	RoundRobinTestSetup()
+
+	routeConfig, routerConfig := MakeRoundRobinTestConfig(1, 1)
+
+	router, err := newRoundRobinRouter(routerConfig, routeConfig)
+	assert.Nil(t, err)
+
+	PretendRoundRobinOpenConnection(router, "ro_vcore", 0, "ro_vcore01")
+
+	idMessage := &common_pb.ID{Id: "1234"}
+
+	idData, err := proto.Marshal(idMessage)
+	assert.Nil(t, err)
+
+	sel := &requestFrame{payload: idData,
+		err:        nil,
+		methodInfo: newMethodDetails("/voltha.VolthaService/ListDevicePorts")}
+
+	backend, connection := router.Route(sel)
+
+	assert.Nil(t, sel.err)
+	assert.NotNil(t, backend)
+	assert.Equal(t, "ro_vcore0", backend.name)
+	assert.Nil(t, connection)
+
+	// Since we only have one backend, calling Route a second time should return the same one
+
+	backend, connection = router.Route(sel)
+
+	assert.Nil(t, sel.err)
+	assert.NotNil(t, backend)
+	assert.Equal(t, "ro_vcore0", backend.name)
+	assert.Nil(t, connection)
+}
+
+// Tests a cluster with two Backends
+func TestRoundRobinRouteTwo(t *testing.T) {
+	RoundRobinTestSetup()
+
+	routeConfig, routerConfig := MakeRoundRobinTestConfig(2, 1)
+
+	router, err := newRoundRobinRouter(routerConfig, routeConfig)
+	assert.Nil(t, err)
+
+	PretendRoundRobinOpenConnection(router, "ro_vcore", 0, "ro_vcore01")
+	PretendRoundRobinOpenConnection(router, "ro_vcore", 1, "ro_vcore11")
+
+	idMessage := &common_pb.ID{Id: "1234"}
+
+	idData, err := proto.Marshal(idMessage)
+	assert.Nil(t, err)
+
+	sel := &requestFrame{payload: idData,
+		err:        nil,
+		methodInfo: newMethodDetails("/voltha.VolthaService/ListDevicePorts")}
+
+	backend, connection := router.Route(sel)
+
+	assert.Nil(t, sel.err)
+	assert.NotNil(t, backend)
+	assert.Equal(t, "ro_vcore0", backend.name)
+	assert.Nil(t, connection)
+
+	// Since we have two backends, calling Route a second time should return the second
+
+	backend, connection = router.Route(sel)
+
+	assert.Nil(t, sel.err)
+	assert.NotNil(t, backend)
+	assert.Equal(t, "ro_vcore1", backend.name)
+	assert.Nil(t, connection)
+
+	// Calling Route a third time should return the first again
+
+	backend, connection = router.Route(sel)
+
+	assert.Nil(t, sel.err)
+	assert.NotNil(t, backend)
+	assert.Equal(t, "ro_vcore0", backend.name)
+	assert.Nil(t, connection)
+}
+
+// Tests a cluster with one backend but no open connections
+func TestRoundRobinRouteOneNoOpenConnection(t *testing.T) {
+	RoundRobinTestSetup()
+
+	routeConfig, routerConfig := MakeRoundRobinTestConfig(1, 1)
+
+	router, err := newRoundRobinRouter(routerConfig, routeConfig)
+	assert.Nil(t, err)
+
+	idMessage := &common_pb.ID{Id: "1234"}
+
+	idData, err := proto.Marshal(idMessage)
+	assert.Nil(t, err)
+
+	sel := &requestFrame{payload: idData,
+		err:        nil,
+		methodInfo: newMethodDetails("/voltha.VolthaService/ListDevicePorts")}
+
+	backend, connection := router.Route(sel)
+
+	assert.EqualError(t, sel.err, "No backend with open connections found")
+	assert.Nil(t, backend)
+	assert.Nil(t, connection)
+}
diff --git a/afrouter/afrouter/source-router_test.go b/afrouter/afrouter/source-router_test.go
index 3d35d6e..742c238 100644
--- a/afrouter/afrouter/source-router_test.go
+++ b/afrouter/afrouter/source-router_test.go
@@ -17,19 +17,15 @@
 package afrouter
 
 import (
-	//	"github.com/fullstorydev/grpcurl"
 	"github.com/golang/protobuf/proto"
-	//	descpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
-	//	"github.com/jhump/protoreflect/dynamic"
 	"github.com/opencord/voltha-go/common/log"
 	common_pb "github.com/opencord/voltha-protos/go/common"
 	"github.com/stretchr/testify/assert"
-	//"io/ioutil"
 	"testing"
 )
 
 const (
-	PROTOFILE = "../../vendor/github.com/opencord/voltha-protos/go/voltha.pb"
+	SOURCE_ROUTER_PROTOFILE = "../../vendor/github.com/opencord/voltha-protos/go/voltha.pb"
 )
 
 func init() {
@@ -37,7 +33,7 @@
 	log.AddPackage(log.JSON, log.WarnLevel, nil)
 }
 
-func MakeTestConfig() (*ConnectionConfig, *BackendConfig, *BackendClusterConfig, *RouteConfig, *RouterConfig) {
+func MakeSourceRouterTestConfig() (*ConnectionConfig, *BackendConfig, *BackendClusterConfig, *RouteConfig, *RouterConfig) {
 	connectionConfig := ConnectionConfig{
 		Name: "ro_vcore01",
 		Addr: "foo",
@@ -69,13 +65,13 @@
 		ProtoService: "VolthaService",
 		ProtoPackage: "voltha",
 		Routes:       []RouteConfig{routeConfig},
-		ProtoFile:    PROTOFILE,
+		ProtoFile:    SOURCE_ROUTER_PROTOFILE,
 	}
 	return &connectionConfig, &backendConfig, &backendClusterConfig, &routeConfig, &routerConfig
 }
 
 func TestSourceRouterInit(t *testing.T) {
-	_, _, _, routeConfig, routerConfig := MakeTestConfig()
+	_, _, _, routeConfig, routerConfig := MakeSourceRouterTestConfig()
 
 	router, err := newSourceRouter(routerConfig, routeConfig)
 
@@ -93,8 +89,8 @@
 	assert.Equal(t, router.ReplyHandler("foo"), nil)
 }
 
-func TestDecodeProtoField(t *testing.T) {
-	_, _, _, routeConfig, routerConfig := MakeTestConfig()
+func TestSourceRouterDecodeProtoField(t *testing.T) {
+	_, _, _, routeConfig, routerConfig := MakeSourceRouterTestConfig()
 
 	router, err := newSourceRouter(routerConfig, routeConfig)
 	assert.Equal(t, err, nil)
@@ -113,8 +109,8 @@
 	assert.Equal(t, s, "ro_vcore0.ro_vcore01")
 }
 
-func TestRoute(t *testing.T) {
-	_, _, _, routeConfig, routerConfig := MakeTestConfig()
+func TestSourceRouterRoute(t *testing.T) {
+	_, _, _, routeConfig, routerConfig := MakeSourceRouterTestConfig()
 
 	router, err := newSourceRouter(routerConfig, routeConfig)
 	assert.Equal(t, err, nil)
@@ -128,7 +124,7 @@
 
 	sel := &requestFrame{payload: loggingData,
 		err:        nil,
-		methodInfo: newMethodDetails("/volta.VolthaService/UpdateLogLevel")}
+		methodInfo: newMethodDetails("/voltha.VolthaService/UpdateLogLevel")}
 
 	backend, connection := router.Route(sel)
 
