There are 3 indicators for us in this: the moral test, the relational test and the truth test.
These passages contain information for us on each of these indicators. With the moral test we are directed to the keeping of God’s commands and especially Jesus’ words: ‘If you love me you will keep my commands’. This is always in the context of free forgiveness through gospel grace.
The relational test is to do with love. Our first love to God and then to those around us …’Love the Lord your God with all your heart, mind, soul and strength and love your neighbor as yourself’. It is good to ask the question ‘Do I sacrifice what I want to do in order to help someone else’. Finally, there is the test for correct understanding of the teaching about Jesus. Anyone who denies that Jesus is the Christ does not have the truth in them (Vs22). Being in a right relationship with God means receiving by faith what Jesus has accomplished for us at the cross.