-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathGetInvestment.java
More file actions
35 lines (29 loc) · 1.38 KB
/
GetInvestment.java
File metadata and controls
35 lines (29 loc) · 1.38 KB
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
31
32
33
34
35
package ai.pluggy.client.integration;
import static ai.pluggy.client.integration.helper.InvestmentHelper.getPluggyBankInvestments;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import ai.pluggy.client.response.Investment;
import ai.pluggy.client.response.InvestmentsResponse;
import lombok.SneakyThrows;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import retrofit2.Response;
public class GetInvestment extends BaseApiIntegrationTest {
@Disabled("For some reason this is not working agains dev environment, but in local it is.. review why not and reenable this")
@SneakyThrows
@Test
void getInvestment_byExistingId_ok() {
// precondition: get existing investments
InvestmentsResponse investments = getPluggyBankInvestments(client);
String firstInvestmentId = investments.getResults().get(0).getId();
// get investment by existing id
Response<Investment> investmentResponse = client.service().getInvestment(firstInvestmentId)
.execute();
// expect investment response to be valid & match the requested id
assertTrue(investmentResponse.isSuccessful());
Investment investment = investmentResponse.body();
assertNotNull(investment);
assertEquals(investment.getId(), firstInvestmentId);
}
}