diff --git a/go.mod b/go.mod
index 63de9afb6a6cab76b4b155e7f090d3dc470806b9..fcffea8fcde51f29c2f1f78523643a4b9cdd0329 100644
--- a/go.mod
+++ b/go.mod
@@ -32,6 +32,7 @@ require (
 require (
 	cloud.google.com/go/compute v1.23.3 // indirect
 	cloud.google.com/go/compute/metadata v0.2.3 // indirect
+	github.com/brianvoe/gofakeit/v6 v6.26.3
 	github.com/davecgh/go-spew v1.1.1 // indirect
 	github.com/go-kit/log v0.2.1 // indirect
 	github.com/go-logfmt/logfmt v0.6.0 // indirect
diff --git a/go.sum b/go.sum
index 3273d5c5392761e9f4e31b6736f355f3bd1eba6d..fcb538d7446ef905cc38573b2c88d2496b342ac9 100644
--- a/go.sum
+++ b/go.sum
@@ -9,6 +9,8 @@ github.com/avast/retry-go/v4 v4.5.1 h1:AxIx0HGi4VZ3I02jr78j5lZ3M6x1E0Ivxa6b0pUUh
 github.com/avast/retry-go/v4 v4.5.1/go.mod h1:/sipNsvNB3RRuT5iNcb6h73nw3IBmXJ/H3XrCQYSOpc=
 github.com/bep/gowebp v0.2.0 h1:ZVfK8i9PpZqKHEmthQSt3qCnnHycbLzBPEsVtk2ch2Q=
 github.com/bep/gowebp v0.2.0/go.mod h1:ZhFodwdiFp8ehGJpF4LdPl6unxZm9lLFjxD3z2h2AgI=
+github.com/brianvoe/gofakeit/v6 v6.26.3 h1:3ljYrjPwsUNAUFdUIr2jVg5EhKdcke/ZLop7uVg1Er8=
+github.com/brianvoe/gofakeit/v6 v6.26.3/go.mod h1:Xj58BMSnFqcn/fAQeSK+/PLtC5kSb7FJIq4JyGa8vEs=
 github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
 github.com/davecgh/go-spew v0.0.0-20161028175848-04cdfd42973b/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
diff --git a/pkg/extension/action.go b/pkg/extension/action.go
index b81df1fbee173d45584e3117d39943b69e53c5dc..a8062d3ddda18f6a7990eb122262aac336d3a919 100644
--- a/pkg/extension/action.go
+++ b/pkg/extension/action.go
@@ -113,8 +113,15 @@ type Action struct {
 }
 
 func ActionToMap(action *Action) map[string]interface{} {
+	if action == nil {
+		return nil
+	}
+	
 	res := make(map[string]interface{})
-	_ = mapstructure.Decode(action, &res)
+	if err := mapstructure.Decode(action, &res); err != nil {
+		return nil
+	}
+
 	res["kind"] = int64(action.Kind.Number())
 	res["target"] = int64(action.Target.Number())
 	res["view"] = int64(action.View.Number())
diff --git a/pkg/extension/action_test.go b/pkg/extension/action_test.go
new file mode 100644
index 0000000000000000000000000000000000000000..3741b5af10c16c9a6d84ba890b1a7800512cde2b
--- /dev/null
+++ b/pkg/extension/action_test.go
@@ -0,0 +1,77 @@
+package extension
+
+import (
+	"testing"
+
+	pb "git.perx.ru/perxis/perxis-go/proto/extensions"
+	"github.com/brianvoe/gofakeit/v6"
+	"github.com/stretchr/testify/require"
+)
+
+func TestAction(t *testing.T) {
+	t.Run("Protobuf", func(t *testing.T) {
+		var pbAction *pb.Action
+		gofakeit.Struct(&pbAction)
+		action := ActionFromPB(pbAction)
+		result := ActionToPB(action)
+		require.Equal(t, pbAction, result)
+	})
+
+	t.Run("Nil Protobuf", func(t *testing.T) {
+		var pbAction *pb.Action
+		action := ActionFromPB(pbAction)
+		result := ActionToPB(action)
+		require.Equal(t, pbAction, result)
+	})
+
+	t.Run("Map", func(t *testing.T) {
+		var action *Action
+		gofakeit.Struct(&action)
+		dict := ActionToMap(action)
+		result, err := ActionFromMap(dict)
+		require.NoError(t, err)
+		require.Equal(t, action, result)
+	})
+
+	t.Run("Nil Map", func(t *testing.T) {
+		var action *Action
+		dict := ActionToMap(action)
+		result, err := ActionFromMap(dict)
+		require.NoError(t, err)
+		require.Equal(t, &Action{}, result)
+	})
+}
+
+func TestActionRequest(t *testing.T) {
+	t.Run("Protobuf", func(t *testing.T) {
+		var pbAction *pb.ActionRequest
+		gofakeit.Struct(&pbAction)
+		action := ActionRequestFromPB(pbAction)
+		result := ActionRequestToPB(action)
+		require.Equal(t, pbAction, result)
+	})
+
+	t.Run("Nil", func(t *testing.T) {
+		var pbAction *pb.ActionRequest
+		action := ActionRequestFromPB(pbAction)
+		result := ActionRequestToPB(action)
+		require.Equal(t, pbAction, result)
+	})
+}
+
+func TestActionResponse(t *testing.T) {
+	t.Run("Protobuf", func(t *testing.T) {
+		var pbAction *pb.ActionResponse
+		gofakeit.Struct(&pbAction)
+		action := ActionResponseFromPB(pbAction)
+		result := ActionResponseToPB(action)
+		require.Equal(t, pbAction, result)
+	})
+
+	t.Run("Nil", func(t *testing.T) {
+		var pbAction *pb.ActionResponse
+		action := ActionResponseFromPB(pbAction)
+		result := ActionResponseToPB(action)
+		require.Equal(t, pbAction, result)
+	})
+}