package Ġtwitter 4 j Ċ Ċ import Ġorg . assertj . core . api . Assertions . assertThat Ċ import Ġorg . junit . Test Ċ Ċ class ĠPoll Response Test Ġ{ ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġwhen Poll Is Open () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġres Ġ= ĠT weets Response ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠJSONObject ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ"{\" data \": [{ \" attachments \":{\" poll _ ids \":[\" 1 4 1 0 \"] }, \" text \":\" W ing ed ĠH uss ars \",\" author _ id \":\" 2 7 3 \",\" id \":\" 1 1 9 0 \" }], \" includes \":{\" pol ls \": [{ \" options \": [{ \" position \": 1 ,\" label \":\" Pol and \",\" votes \": 1 },{ \" position \": 2 ,\" label \":\" Ger many \",\" votes \": 0 }], \" duration _ minutes \": 1 4 1 0 ,\" id \":\" 1 4 1 0 \",\" v oting _ status \":\" open \",\" end _ datetime \":\" 1 4 1 0 - 0 7 - 1 5 T 1 8 : 0 0 : 0 0 . 0 0 0 Z \" }], \" users \": [{ \" id \":\" 2 7 3 \",\" name \":\" W ÅĤad ys ÅĤ aw ĠJ ag ie ÅĤ ÅĤo \",\" username \":\" King ĠW ÅĤad ys ÅĤ aw ĠJ ag ie ÅĤ ÅĤo \" }] }, \" meta \":{\" new est _ id \":\" 1 1 9 0 \",\" ol dest _ id \":\" 1 1 9 0 \",\" result _ count \": 1 }}" ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map . size ). isEqualTo ( 1 ) ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 1 4 1 0 ]?. id ). isEqualTo ( 1 4 1 0 ) ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 1 4 1 0 ]?. options ?. size ). isEqualTo ( 2 ) ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 1 4 1 0 ]?. v oting Status ). isEqualTo ( Poll . V oting Status . OPEN ) ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 1 4 1 0 ]?. endDate time ). isEqualTo (" 1 4 1 0 - 0 7 - 1 5 T 1 8 : 0 0 : 0 0 . 0 0 0 Z ") ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 1 4 1 0 ]?. duration Minutes ). isEqualTo ( 1 4 1 0 ) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 0 ]?. v oting Status ). isNull () ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 0 ]?. endDate time ). isNull () ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 0 ]?. duration Minutes ). isNull () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġwhen EndDate time Is Absent In Response () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġres Ġ= ĠT weets Response ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠJSONObject ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ"{\" data \": [{ \" attachments \":{\" poll _ ids \":[\" 1 4 1 0 \"] }, \" text \":\" W ing ed ĠH uss ars \",\" author _ id \":\" 2 7 3 \",\" id \":\" 1 1 9 0 \" }], \" includes \":{\" pol ls \": [{ \" options \": [{ \" position \": 1 ,\" label \":\" Pol and \",\" votes \": 1 },{ \" position \": 2 ,\" label \":\" Ger many \",\" votes \": 0 }], \" duration _ minutes \": 1 4 1 0 ,\" id \":\" 1 4 1 0 \",\" v oting _ status \":\" open \" }], \" users \": [{ \" id \":\" 2 7 3 \",\" name \":\" W ÅĤad ys ÅĤ aw ĠJ ag ie ÅĤ ÅĤo \",\" username \":\" King ĠW ÅĤad ys ÅĤ aw ĠJ ag ie ÅĤ ÅĤo \" }] }, \" meta \":{\" new est _ id \":\" 1 1 9 0 \",\" ol dest _ id \":\" 1 1 9 0 \",\" result _ count \": 1 }}" ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map . size ). isEqualTo ( 1 ) ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 1 4 1 0 ]?. id ). isEqualTo ( 1 4 1 0 ) ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 1 4 1 0 ]?. options ?. size ). isEqualTo ( 2 ) ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 1 4 1 0 ]?. v oting Status ). isEqualTo ( Poll . V oting Status . OPEN ) ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 1 4 1 0 ]?. endDate time ). isNull () ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 1 4 1 0 ]?. duration Minutes ). isEqualTo ( 1 4 1 0 ) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 0 ]?. v oting Status ). isNull () ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 0 ]?. endDate time ). isNull () ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 0 ]?. duration Minutes ). isNull () ĊĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġwhen V oting Status Is Absent In Response () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġres Ġ= ĠT weets Response ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠJSONObject ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ"{\" data \": [{ \" attachments \":{\" poll _ ids \":[\" 1 4 1 0 \"] }, \" text \":\" W ing ed ĠH uss ars \",\" author _ id \":\" 2 7 3 \",\" id \":\" 1 1 9 0 \" }], \" includes \":{\" pol ls \": [{ \" options \": [{ \" position \": 1 ,\" label \":\" Pol and \",\" votes \": 1 },{ \" position \": 2 ,\" label \":\" Ger many \",\" votes \": 0 }], \" duration _ minutes \": 1 4 1 0 ,\" id \":\" 1 4 1 0 \",\" end _ datetime \":\" 1 4 1 0 - 0 7 - 1 5 T 1 8 : 0 0 : 0 0 . 0 0 0 Z \" }], \" users \": [{ \" id \":\" 2 7 3 \",\" name \":\" W ÅĤad ys ÅĤ aw ĠJ ag ie ÅĤ ÅĤo \",\" username \":\" King ĠW ÅĤad ys ÅĤ aw ĠJ ag ie ÅĤ ÅĤo \" }] }, \" meta \":{\" new est _ id \":\" 1 1 9 0 \",\" ol dest _ id \":\" 1 1 9 0 \",\" result _ count \": 1 }}" ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map . size ). isEqualTo ( 1 ) ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 1 4 1 0 ]?. id ). isEqualTo ( 1 4 1 0 ) ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 1 4 1 0 ]?. options ?. size ). isEqualTo ( 2 ) ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 1 4 1 0 ]?. v oting Status ). isNull () ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 1 4 1 0 ]?. endDate time ). isEqualTo (" 1 4 1 0 - 0 7 - 1 5 T 1 8 : 0 0 : 0 0 . 0 0 0 Z ") ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 1 4 1 0 ]?. duration Minutes ). isEqualTo ( 1 4 1 0 ) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 0 ]?. v oting Status ). isNull () ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 0 ]?. endDate time ). isNull () ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 0 ]?. duration Minutes ). isNull () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġwhen Poll Is Close () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġres Ġ= ĠT weets Response ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠJSONObject ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ"{\" data \": [{ \" id \":\" 1 1 9 0 \",\" author _ id \":\" 2 7 3 \",\" text \":\" W ing ed ĠH uss ars \",\" attachments \":{\" poll _ ids \":[\" 1 4 1 0 \"] }}], \" includes \":{\" pol ls \": [{ \" id \":\" 1 4 1 0 \",\" options \": [{ \" position \": 1 ,\" label \":\" Pol and \",\" votes \": 1 },{ \" position \": 2 ,\" label \":\" Ger many \",\" votes \": 0 }], \" v oting _ status \":\" closed \",\" end _ datetime \":\" 1 4 1 0 - 0 7 - 1 5 T 1 8 : 0 0 : 0 0 . 0 0 0 Z \",\" duration _ minutes \": 5 }], \" users \": [{ \" id \":\" 2 7 3 \",\" name \":\" W ÅĤad ys ÅĤ aw ĠJ ag ie ÅĤ ÅĤo \",\" username \":\" King ĠW ÅĤad ys ÅĤ aw ĠJ ag ie ÅĤ ÅĤo \" }] }, \" meta \":{\" new est _ id \":\" 1 9 3 9 \",\" ol dest _ id \":\" 1 9 3 9 \",\" result _ count \": 1 }}" ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map . size ). isEqualTo ( 1 ) ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 1 4 1 0 ]?. id ). isEqualTo ( 1 4 1 0 ) ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 1 4 1 0 ]?. options ?. size ). isEqualTo ( 2 ) ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 1 4 1 0 ]?. v oting Status ). isEqualTo ( Poll . V oting Status . CLOSED ) ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 1 4 1 0 ]?. endDate time ). isEqualTo (" 1 4 1 0 - 0 7 - 1 5 T 1 8 : 0 0 : 0 0 . 0 0 0 Z ") ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 1 4 1 0 ]?. duration Minutes ). isEqualTo ( 5 ) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 0 ]?. v oting Status ). isNull () ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 0 ]?. endDate time ). isNull () ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 0 ]?. duration Minutes ). isNull () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġwhen Poll IsEmpty () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġres Ġ= ĠT weets Response ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠJSONObject ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ"{\" data \": [{ \" author _ id \":\" 2 7 3 \",\" id \":\" 1 1 9 0 \",\" text \":\" W ing ed ĠH uss ars \" }], \" includes \":{\" users \": [{ \" id \":\" 2 7 3 \",\" name \":\" W ÅĤad ys ÅĤ aw ĠJ ag ie ÅĤ ÅĤo \",\" username \":\" King ĠW ÅĤad ys ÅĤ aw ĠJ ag ie ÅĤ ÅĤo \" }] }, \" meta \":{\" new est _ id \":\" 1 1 9 0 \",\" ol dest _ id \":\" 1 1 9 0 \",\" result _ count \": 1 }}" ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map . size ). isEqualTo ( 0 ) ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 0 ]?. options ). isNull () ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 0 ]?. v oting Status ). isNull () ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 0 ]?. endDate time ). isNull () ĊĠĠĠĠĠĠĠ ĠassertThat ( res . pol ls Map [ 0 ]?. duration Minutes ). isNull () ĊĠĠĠ Ġ} Ċ }