@@ -80,6 +80,7 @@ public void ShouldCallTrackEventTest() throws SecureNativeSDKException, Interrup
8080 JSONAssert .assertEquals (expected , body , false );
8181 assertThat (new JSONObject (body ).has ("rid" )).isTrue ();
8282 assertThat (new JSONObject (body ).has ("timestamp" )).isTrue ();
83+ } catch (SecureNativeInvalidOptionsException ignored ) {
8384 } finally {
8485 eventManager .stopEventsPersist ();
8586 }
@@ -114,8 +115,6 @@ public void ShouldThrowWhenSendingMoreThan10CustomPropertiesToTrackEventTest() t
114115 }
115116 }
116117
117- ;
118-
119118
120119 @ Test
121120 @ Timeout (value = 1000 , unit = TimeUnit .MILLISECONDS )
@@ -131,7 +130,10 @@ public void ShouldNotCallTrackEventWhenAutomaticPersistenceDisabledTest() throws
131130 ApiManager apiManager = new ApiManagerImpl (eventManager , options );
132131
133132 // track async event
134- apiManager .track (eventOptions );
133+ try {
134+ apiManager .track (eventOptions );
135+ } catch (SecureNativeInvalidOptionsException ignored ) {
136+ }
135137
136138 // ensure event to be sent
137139 RecordedRequest lastRequest = server .takeRequest (10 * options .getInterval (), TimeUnit .MILLISECONDS );
@@ -156,7 +158,10 @@ public void ShouldNotRetryUnauthorizedTrackEventCallTest() throws SecureNativeSD
156158 ApiManager apiManager = new ApiManagerImpl (eventManager , options );
157159
158160 // track async event
159- apiManager .track (eventOptions );
161+ try {
162+ apiManager .track (eventOptions );
163+ } catch (SecureNativeInvalidOptionsException ignored ) {
164+ }
160165
161166 try {
162167 // ensure event to be sent
@@ -191,8 +196,13 @@ public void ShouldCallVerifyEventTest() throws SecureNativeSDKException, JsonPro
191196
192197
193198 // call verify event
194- VerifyResult result = apiManager .verify (eventOptions );
199+ VerifyResult result = null ;
200+ try {
201+ result = apiManager .verify (eventOptions );
202+ } catch (SecureNativeInvalidOptionsException ignored ) {
203+ }
195204
205+ assert result != null ;
196206 assertThat (result .getRiskLevel ()).isEqualTo (verifyResult .getRiskLevel ());
197207 assertThat (result .getScore ()).isEqualTo (verifyResult .getScore ());
198208 assertThat (result .getTriggers ().length ).isEqualTo (verifyResult .getTriggers ().length );
@@ -220,7 +230,13 @@ public void ShouldFailVerifyEventCallWhenUnauthorizedTest() throws SecureNativeS
220230 ApiManager apiManager = new ApiManagerImpl (eventManager , options );
221231
222232 // call verify event
223- VerifyResult verifyResult = apiManager .verify (eventOptions );
233+ VerifyResult verifyResult = null ;
234+ try {
235+ verifyResult = apiManager .verify (eventOptions );
236+ } catch (SecureNativeInvalidOptionsException ignored ) {
237+ }
238+
239+ assert verifyResult != null ;
224240 assertThat (verifyResult .getRiskLevel ()).isEqualTo (RiskLevel .LOW );
225241 assertThat (verifyResult .getScore ()).isEqualTo (0 );
226242 assertThat (verifyResult .getTriggers ().length ).isEqualTo (0 );
@@ -230,8 +246,6 @@ public void ShouldFailVerifyEventCallWhenUnauthorizedTest() throws SecureNativeS
230246 RecordedRequest lastRequest = server .takeRequest (10 * options .getInterval (), TimeUnit .MILLISECONDS );
231247 String lastRequestBody = lastRequest != null ? lastRequest .getBody ().readUtf8 () : null ;
232248
233- String expected = "{\" eventType\" :\" sn.user.login\" ,\" userId\" :\" USER_ID\" ,\" userTraits\" :{\" name\" :\" USER_NAME'\" ,\" email\" :\" USER_EMAIL'\" ,\" createdAt\" :null},\" request\" :{\" cid\" :null,\" vid\" :null,\" fp\" :null,\" ip\" :\" 127.0.0.1\" ,\" remoteIp\" :null,\" headers\" :{\" user-agent\" :\" Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Mobile/7B405\" },\" url\" :null,\" method\" :null},\" properties\" :{\" prop2\" :true,\" prop1\" :\" CUSTOM_PARAM_VALUE\" ,\" prop3\" :3}}" ;
234249 assertThat (lastRequestBody ).isNotNull ();
235-
236250 }
237251}
0 commit comments