fix failing tests and add pre & post integration phase