package Ġio . ipfs . kotlin Ċ Ċ import Ġokhttp 3 . mock webserver . Mock Response Ċ import Ġorg . assertj . core . api . Assertions . assertThat Ċ import Ġorg . junit . Test Ċ Ċ class ĠTest Stats Ġ: ĠBase Ip fs Web server Test () Ġ{ ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Band Width Stats () Ġ{ ĊĠĠĠĠĠĠĠ Ġ// Ġsetup ĊĠĠĠĠĠĠĠ Ġserver . enqueue ( Mock Response (). set Body ("{ \" Total In \": 8 0 4 6 1 1 6 5 ,\" Total Out \": 7 0 9 9 8 9 4 8 ,\" Rate In \": 1 1 0 3 . 8 8 3 0 7 6 9 5 4 0 5 1 1 ,\" Rate Out \": 1 8 1 4 . 6 4 1 7 3 8 1 0 1 9 0 4 4 }\ n ")) ĊĊĠĠĠĠĠĠĠ Ġ// Ġinvoke ĊĠĠĠĠĠĠĠ Ġval Ġstats Band Width Ġ= Ġip fs . stats . band Width () ĊĊĠĠĠĠĠĠĠ Ġ// Ġassert ĊĠĠĠĠĠĠĠ ĠassertThat ( stats Band Width ). isNotNull () ĊĠĠĠĠĠĠĠ ĠassertThat ( stats Band Width !!. Total In ). isEqualTo ( 8 0 4 6 1 1 6 5 ) ĊĠĠĠĠĠĠĠ ĠassertThat ( stats Band Width . Total Out ). isEqualTo ( 7 0 9 9 8 9 4 8 ) ĊĠĠĠĠĠĠĠ ĠassertThat ( stats Band Width . Rate In ). isEqualTo ( 1 1 0 3 . 8 8 3 0 7 6 9 5 4 0 5 1 1 ) ĊĠĠĠĠĠĠĠ ĠassertThat ( stats Band Width . Rate Out ). isEqualTo ( 1 8 1 4 . 6 4 1 7 3 8 1 0 1 9 0 4 4 ) ĊĊĠĠĠĠĠĠĠ Ġval Ġexecuted Request Ġ= Ġserver . take Request () ĊĠĠĠĠĠĠĠ ĠassertThat ( executed Request . path ). isEqualTo ("/ stats / bw ") ĊĊĠĠĠ Ġ} Ċ }