use of com.github.robozonky.api.strategies.RecommendedParticipation in project robozonky by RoboZonky.
the class NaturalLanguagePurchaseStrategyTest method unacceptablePortfolioDueToOverInvestment.
@Test
void unacceptablePortfolioDueToOverInvestment() {
final DefaultValues v = new DefaultValues(DefaultPortfolio.EMPTY);
v.setTargetPortfolioSize(1000);
final ParsedStrategy p = new ParsedStrategy(v);
final PurchaseStrategy s = new NaturalLanguagePurchaseStrategy(p);
final PortfolioOverview portfolio = mock(PortfolioOverview.class);
when(portfolio.getCzkAvailable()).thenReturn(p.getMinimumBalance());
when(portfolio.getCzkInvested()).thenReturn(p.getMaximumInvestmentSizeInCzk());
final Stream<RecommendedParticipation> result = s.recommend(Collections.singletonList(mockDescriptor()), portfolio, new Restrictions());
assertThat(result).isEmpty();
}
Aggregations