Added utility structures + tests

This commit is contained in:
Marvin Scham
2023-06-07 05:46:03 +02:00
parent b9fb6cbc89
commit 3ba366684c
19 changed files with 624 additions and 11 deletions

View File

@@ -6,8 +6,11 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import de.rwu.easydrop.api.client.DataSourceFactory;
import de.rwu.easydrop.model.ProductCatalogue;
import de.rwu.easydrop.service.retriever.CatalogueRetriever;
import de.rwu.easydrop.service.retriever.ProductRetriever;
import de.rwu.easydrop.util.Config;
import de.rwu.easydrop.util.ProductsConfig;
/**
* Kickoff point for the service.
@@ -34,12 +37,15 @@ public final class Main {
*/
public static void main(final String[] args) throws ConfigurationException {
Config config = Config.getInstance();
ProductsConfig pConfig = ProductsConfig.getInstance();
DataSourceFactory dataSourceFactory = new DataSourceFactory(config);
ProductRetriever retriever = new ProductRetriever(dataSourceFactory);
CatalogueRetriever catRetriever = new CatalogueRetriever(pConfig, retriever);
String amznProduct = retriever.getProductFromAmazon("B096Y2TYKV").toString();
LOGGER.info(amznProduct);
String ebayProduct = retriever.getProductFromEbay("Gigabyte GeForce RTX 3060").toString();
LOGGER.info(ebayProduct);
catRetriever.loadCatalogues();
for (ProductCatalogue pCat : catRetriever.getProductCatalogues()) {
String pCatStr = pCat.toString();
LOGGER.info(pCatStr);
}
}
}