1- package pl .smsapi .test . unit . response ;
1+ package pl .smsapi .api . action . hlr ;
22
33import org .junit .Test ;
4- import pl .smsapi .api .action .hlr .HLRCheckNumber ;
54import pl .smsapi .api .response .CheckNumberResponse ;
65import pl .smsapi .api .response .NumberResponse ;
76import pl .smsapi .exception .SmsapiException ;
@@ -17,34 +16,16 @@ public class CheckNumberResponseTest {
1716
1817 @ Test
1918 public void deserialize_non_empty_response () throws SmsapiException {
20- HLRCheckNumber action = new HLRCheckNumber ();
19+ HLRCheckNumber action = new HLRCheckNumber ("500600700" );
2120 action .client (new ClientStub ());
22- action .proxy (new ProxyResponseStub (
23- "{" +
24- " \" count\" : 1," +
25- " \" list\" : [" +
26- " {" +
27- " \" date\" : 1712565008," +
28- " \" id\" : \" 1\" ," +
29- " \" info\" : \" Resource description\" ," +
30- " \" mcc\" : 260," +
31- " \" mnc\" : 3," +
32- " \" number\" : \" 500600700\" ," +
33- " \" ported\" : 0," +
34- " \" ported_from\" : 3," +
35- " \" price\" : 0.04," +
36- " \" status\" : \" OK\" " +
37- " }" +
38- " ]" +
39- "}"
40- ));
21+ action .proxy (new ProxyResponseStub (CheckNumberMother .create ()));
4122
4223 CheckNumberResponse response = action .execute ();
4324
44- assertFalse (response .getList () .isEmpty ());
45- assertEquals (1 , response .getCount () );
25+ assertFalse (response .list .isEmpty ());
26+ assertEquals (1 , response .count );
4627
47- Optional <NumberResponse > hlr1 = response .getList () .stream ().filter (
28+ Optional <NumberResponse > hlr1 = response .list .stream ().filter (
4829 hlrResponse -> hlrResponse .getId ().equals ("1" )
4930 ).findFirst ();
5031 assertTrue (hlr1 .isPresent ());
0 commit comments