-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClientTest.java
30 lines (25 loc) · 1.07 KB
/
ClientTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package org.example.client;
import com.cloudesire.platform.apiclient.CloudesireClient;
import com.cloudesire.platform.apiclient.CloudesireClientCallExecutor;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.liberologico.cloudesire.cmw.model.dto.ProductDTO;
import org.junit.Test;
import java.util.List;
import static org.junit.Assert.assertNotNull;
public class ClientTest
{
@Test
public void defaultTest()
{
ObjectMapper mapper = new ObjectMapper();
mapper.configure( DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false );
CloudesireClientCallExecutor exec = new CloudesireClientCallExecutor( mapper );
CloudesireClient.Builder builder = new CloudesireClient.Builder()
.setBaseUrl( "https://demo-backend.cloudesire.com/api/" )
.setMapper( mapper );
CloudesireClient client = builder.build();
List<ProductDTO> products = exec.execute( client.getProductApi().getAll() );
assertNotNull( products );
}
}