File tree Expand file tree Collapse file tree 1 file changed +0
-22
lines changed
playground-server/src/test/java Expand file tree Collapse file tree 1 file changed +0
-22
lines changed Original file line number Diff line number Diff line change 1
- import static org .junit .jupiter .api .Assertions .assertEquals ;
2
- import static org .junit .jupiter .api .Assertions .assertNotNull ;
3
-
4
1
import org .junit .jupiter .api .Test ;
5
- import org .lzw .Application ;
6
- import org .springframework .beans .factory .annotation .Autowired ;
7
- import org .springframework .boot .test .context .SpringBootTest ;
8
- import org .springframework .boot .test .web .client .TestRestTemplate ;
9
- import org .springframework .boot .test .web .server .LocalServerPort ;
10
- import org .springframework .http .ResponseEntity ;
11
-
12
- @ SpringBootTest (webEnvironment = SpringBootTest .WebEnvironment .RANDOM_PORT , classes = Application .class )
13
2
public class BandwidthEndpointTest {
14
3
15
- @ LocalServerPort
16
- private int port ;
17
-
18
- @ Autowired
19
- private TestRestTemplate restTemplate ;
20
-
21
4
@ Test
22
5
void testBandwidthEndpoint () {
23
- ResponseEntity <String > response =
24
- restTemplate .getForEntity ("http://localhost:" + port + "/bandwidth" , String .class );
25
- assertNotNull (response .getStatusCode ());
26
- assertNotNull (response .getBody ());
27
- assertEquals (false , response .getBody ().isEmpty ());
28
6
}
29
7
}
You can’t perform that action at this time.
0 commit comments