test: Close the connection if there is "application"