@@ -38,6 +38,17 @@ def setup
38
38
phone_number_lookup_basic_auth_user_name : BW_USERNAME ,
39
39
phone_number_lookup_basic_auth_password : BW_PASSWORD
40
40
)
41
+
42
+ @bandwidth_client_invalid_auth = Bandwidth ::Client . new (
43
+ voice_basic_auth_user_name : "bad_username" ,
44
+ voice_basic_auth_password : "bad_password" ,
45
+ messaging_basic_auth_user_name : "bad_username" ,
46
+ messaging_basic_auth_password : "bad_password" ,
47
+ multi_factor_auth_basic_auth_user_name : "bad_username" ,
48
+ multi_factor_auth_basic_auth_password : "bad_password" ,
49
+ phone_number_lookup_basic_auth_user_name : "bad_username" ,
50
+ phone_number_lookup_basic_auth_password : "bad_password"
51
+ )
41
52
end
42
53
43
54
def test_create_message
@@ -79,6 +90,19 @@ def test_upload_download_media
79
90
assert_equal ( downloaded_media , media , "Downloaded media file not equal to upload" )
80
91
end
81
92
93
+ def test_get_message
94
+ # Send a successful request to the GET messages API
95
+ response = @bandwidth_client . messaging_client . client . get_messages ( BW_ACCOUNT_ID , :message_id => "abc123" )
96
+ assert_equal ( response . status_code , 200 , "API did not return a 200 OK" )
97
+ end
98
+
99
+ def test_get_message_invalid_auth
100
+ # Send an unsuccessful request to the GET messages API
101
+ assert_raise MessagingException do
102
+ response = @bandwidth_client_invalid_auth . messaging_client . client . get_messages ( BW_ACCOUNT_ID )
103
+ end
104
+ end
105
+
82
106
def test_create_call_and_get_call_state
83
107
body = CreateCallRequest . new
84
108
body . from = BW_NUMBER
0 commit comments