SuperX-Kernmodul
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

71 lines
2.1 KiB

package de.superx.bianalysis;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import de.superx.BIATestUtils;
import de.superx.BaseDbTest;
import de.superx.bianalysis.models.Right;
import de.superx.bianalysis.models.RightParam;
import de.superx.bianalysis.rest.BiAnalysisApi;
import de.superx.bianalysis.service.DbMetaAdapter;
import de.superx.rest.model.Result;
public class BiAnalysis331884Test extends BaseDbTest {
@Autowired
BiAnalysisApi biAnalysis;
@Autowired
DbMetaAdapter dbAdapter;
@Before
public void init() {
//user = getTestUserService().createTestUser(true, null);
setRight(Right.CREATE_ANALYSIS);
}
public static final String BI_ANALYSIS_FIXTURES = String.join(File.separator,
"test",
"resources",
"db",
"fixtures",
"ticket331884"
);
@Test
public void testAkzeptanzkriterienAusgruendungen() throws Exception {
testAk("research_relationship", "4-1-1");
}
@Test
public void testAkzeptanzkriterienForschungsinfrastruktur() throws Exception {
testAk("infrastructure", "4-1-1");
testAk("infrastructure", "4-2-1");
testAk("infrastructure", "4-3-1");
testAk("infrastructure", "4-4-1");
}
private void testAk(String fact, String ak) {
System.out.println("Testing " + fact + " " + ak);
String requestFile = BI_ANALYSIS_FIXTURES + File.separator + fact + "_" + ak + ".json";
String fixtureFile = BI_ANALYSIS_FIXTURES + File.separator + fact + "_"+ ak + "_response.json" ;
ReportDefinition definition = BIATestUtils.getReportDefinitionFromFile(requestFile);
Result fixtureResult = BIATestUtils.readResultFromJson(fixtureFile);
try {
Result result = biAnalysis.getReport(definition);
BIATestUtils.compareResultColumns(result, fixtureResult);
BIATestUtils.compareCellsForEquality(result, fixtureResult);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}