def assertJsonContains(jsonStr=None, key=None, message=None):
    if jsonStr is not None:
        try:
            data = json.loads(jsonStr)
            if key not in data:
                raise TestStepFail(
                    format_message(message) if message is not None else "Assert: "
                                                                        "Key : %s is not "
                                                                        "in : %s" % (str(key),
                                                                                     str(jsonStr)))
        except (TypeError, ValueError) as e:
            raise TestStepFail(
                format_message(message) if message is not None else "Unable to parse json "+str(e))
    else:
        raise TestStepFail(
            format_message(message) if message is not None else "Json string is empty")