use of name.abuchen.portfolio.model.Bookmark in project portfolio by buchen.
the class BookmarkTest method testURLCreation.
@Test
public void testURLCreation() {
Bookmark page = new Bookmark("", "http://{tickerSymbol,isin,wkn,name}");
Security security = new Security("Daimler", "DE0007100000", "", YahooFinanceQuoteFeed.ID);
security.setWkn("12345");
assertThat(page.constructURL(new Client(), security), equalTo("http://DE0007100000"));
security.setTickerSymbol("DAI.DE");
assertThat(page.constructURL(new Client(), security), equalTo("http://DAI.DE"));
page = new Bookmark("", "http://{isin,tickerSymbol,wkn,name}");
assertThat(page.constructURL(new Client(), security), equalTo("http://DE0007100000"));
}
use of name.abuchen.portfolio.model.Bookmark in project portfolio by buchen.
the class BookmarkTest method testIfUnknownKeysAreFound.
@Test
public void testIfUnknownKeysAreFound() {
Bookmark page = new Bookmark("", "https://www.flatex.de/suche/{something}");
Security security = new Security("Daimler", "DE0007100000", "", YahooFinanceQuoteFeed.ID);
security.setWkn("12345");
assertThat(page.constructURL(new Client(), security), equalTo("https://www.flatex.de/suche/"));
}
use of name.abuchen.portfolio.model.Bookmark in project portfolio by buchen.
the class BookmarkTest method testMultipleKeyReplacement.
@Test
public void testMultipleKeyReplacement() {
Bookmark page = new Bookmark("", "https://www.flatex.de/suche/?q={wkn}&isin={isin}");
Security security = new Security("Daimler", "DE0007100000", "", YahooFinanceQuoteFeed.ID);
security.setWkn("12345");
assertThat(page.constructURL(new Client(), security), equalTo("https://www.flatex.de/suche/?q=12345&isin=DE0007100000"));
}
use of name.abuchen.portfolio.model.Bookmark in project portfolio by buchen.
the class BookmarkTest method testTickerSymbolPrefix.
@Test
public void testTickerSymbolPrefix() {
Bookmark page = new Bookmark("", "https://www.flatex.de/suche/{tickerSymbolPrefix}");
Security security = new Security("Daimler", "DE0007100000", "DAI.DE", YahooFinanceQuoteFeed.ID);
assertThat(page.constructURL(new Client(), security), equalTo("https://www.flatex.de/suche/DAI"));
}
use of name.abuchen.portfolio.model.Bookmark in project portfolio by buchen.
the class BookmarkTest method testIfNoReplacmentsAreFound.
@Test
public void testIfNoReplacmentsAreFound() {
Bookmark page = new Bookmark("", "https://www.flatex.de/suche/XXX");
Security security = new Security("Daimler", "DE0007100000", "", YahooFinanceQuoteFeed.ID);
security.setWkn("12345");
assertThat(page.constructURL(new Client(), security), equalTo("https://www.flatex.de/suche/XXX"));
}
Aggregations