|
1 | 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.resources; |
2 | 2 |
|
| 3 | +import com.jaspersoft.jasperserver.dto.resources.ClientFolder; |
3 | 4 | import com.jaspersoft.jasperserver.dto.resources.ClientResource; |
4 | 5 | import com.jaspersoft.jasperserver.jaxrs.client.RestClientTestUtil; |
| 6 | +import com.jaspersoft.jasperserver.jaxrs.client.core.operationresult.OperationResult; |
5 | 7 | import java.io.ByteArrayInputStream; |
6 | 8 | import javax.ws.rs.core.Response; |
7 | 9 | import org.testng.Assert; |
8 | 10 | import org.testng.annotations.AfterClass; |
9 | 11 | import org.testng.annotations.BeforeClass; |
10 | 12 | import org.testng.annotations.Test; |
11 | 13 |
|
| 14 | +import static org.testng.AssertJUnit.assertNotNull; |
| 15 | + |
12 | 16 | /** |
13 | 17 | * @author Alexander Krasnyanskiy |
14 | 18 | * @author tetiana Iefimenko |
@@ -51,6 +55,28 @@ public void should_return_resource_details() throws InterruptedException { |
51 | 55 | Assert.assertNotNull(clientResource.getCreationDate()); |
52 | 56 | } |
53 | 57 |
|
| 58 | + |
| 59 | + |
| 60 | + @Test |
| 61 | + public void should_return_resource() throws InterruptedException { |
| 62 | + |
| 63 | + // When |
| 64 | + OperationResult<ClientFolder> clientFolderOperationResult = session.resourcesService() |
| 65 | + .resource("/").get(ClientFolder.class); |
| 66 | + Assert.assertTrue(clientFolderOperationResult.getResponse().getStatus() == 200); |
| 67 | + assertNotNull(clientFolderOperationResult.getEntity()); |
| 68 | + assertNotNull(clientFolderOperationResult.getEntity().getVersion()); |
| 69 | + |
| 70 | + OperationResult<ClientResource> clientResource = session.resourcesService() |
| 71 | + .resource("/").get(ClientResource.class); |
| 72 | + Assert.assertTrue(clientResource.getResponse().getStatus() == 200); |
| 73 | + assertNotNull(clientResource.getEntity()); |
| 74 | + assertNotNull(clientResource.getEntity().getVersion()); |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | + } |
| 79 | + |
54 | 80 | @AfterClass |
55 | 81 | public void after() { |
56 | 82 | session.logout(); |
|
0 commit comments