Check if connected.

Added a check to see if it is possible to post data to the system. Otherwise, dont run the tests. This is because trying to connect to elasticsearch when it is not running causes errros with no end.