D-15753 added functional tests and change logic to check without hard coded logic