2018-07-05 18:29:38 +02:00
|
|
|
package org.gcube.portlets.user.accountingdashboard;
|
|
|
|
|
|
|
|
import org.gcube.portlets.user.accountingdashboard.server.accounting.AccountingService;
|
2018-07-06 17:48:46 +02:00
|
|
|
import org.gcube.portlets.user.accountingdashboard.server.accounting.AccountingServiceType;
|
2018-07-05 18:29:38 +02:00
|
|
|
import org.gcube.portlets.user.accountingdashboard.shared.Constants;
|
|
|
|
import org.junit.Test;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
|
|
import junit.framework.TestCase;
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @author Giancarlo Panichi
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public class AccountingServiceTest extends TestCase {
|
|
|
|
private static Logger logger = LoggerFactory.getLogger(AccountingServiceTest.class);
|
|
|
|
|
|
|
|
@Test
|
2018-07-16 18:56:04 +02:00
|
|
|
public void testService() {
|
2018-07-05 18:29:38 +02:00
|
|
|
if (Constants.TEST_ENABLE) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
AuthTest.setToken();
|
2018-07-06 17:48:46 +02:00
|
|
|
AccountingService accountingService = new AccountingService(AccountingServiceType.CurrentScope);
|
2018-07-16 18:56:04 +02:00
|
|
|
// accountingService.getTree();
|
2018-07-05 18:29:38 +02:00
|
|
|
|
|
|
|
assertTrue("Success", true);
|
|
|
|
} catch (Throwable e) {
|
|
|
|
logger.error(e.getLocalizedMessage(), e);
|
|
|
|
fail("Error:" + e.getLocalizedMessage());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
assertTrue("Success", true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-06 17:48:46 +02:00
|
|
|
@Test
|
|
|
|
public void testData() {
|
|
|
|
if (Constants.TEST_ENABLE) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
assertTrue("Success", true);
|
2018-07-16 18:56:04 +02:00
|
|
|
|
2018-07-06 17:48:46 +02:00
|
|
|
} catch (Throwable e) {
|
|
|
|
logger.error(e.getLocalizedMessage(), e);
|
|
|
|
fail("Error:" + e.getLocalizedMessage());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
assertTrue("Success", true);
|
|
|
|
}
|
|
|
|
}
|
2018-07-05 18:29:38 +02:00
|
|
|
|
|
|
|
}
|