relax assert, riksdagen api does not include end date before adding new
politicians.
public final class DataViewerITest extends
AbstractServiceDataFunctionalIntegrationTest {
+ /** The Constant NUMBER_PARLIMENT_MEMBERS. */
+ private static final int NUMBER_PARLIMENT_MEMBERS = 349;
+
/** The Constant EXPECT_VALUE_IN_DATABASE. */
private static final String EXPECT_VALUE_IN_DATABASE = "Expect value in database";
- /** The Constant SHOULD_ALWAYS_BE_349_IN_PARLIAMENT. */
- private static final String SHOULD_ALWAYS_BE_349_IN_PARLIAMENT = "Should always be 349 in parliament";
+ /** The Constant PARLIAMENT_DATA. */
+ private static final String PARLIAMENT_DATA = "Riksdagen api data not always acccurate, do expect at least " + NUMBER_PARLIMENT_MEMBERS;
/** The Constant EXPECT_SAME_OBJECT_LOADED. */
private static final String EXPECT_SAME_OBJECT_LOADED = "Expect same object loaded";
@@ -226,7 +229,7 @@ public void viewRiksdagenPartySummary() throws Exception {
final List<ViewRiksdagenPolitician> activeWithNoParty = dataViewer.findOrderedListByProperty(ViewRiksdagenPolitician.class,ViewRiksdagenPolitician_.firstAssignmentDate, new Object[] {true,null},ViewRiksdagenPolitician_.activeParliament,ViewRiksdagenPolitician_.party);
- assertEquals(SHOULD_ALWAYS_BE_349_IN_PARLIAMENT, 349, parliamentSum + activeWithNoParty.size());
+ assertTrue(PARLIAMENT_DATA, ( parliamentSum + activeWithNoParty.size()) >= 349);
// assertEquals(
// "Should always be 20 in eu, but riksdagen data contains only 15",
// 15, euSum);
@@ -265,10 +268,10 @@ public void viewRiksdagenPolitician() throws Exception {
viewRiksdagenPoliticianFound);
- assertEquals(SHOULD_ALWAYS_BE_349_IN_PARLIAMENT,349,dataViewer
+ assertTrue(PARLIAMENT_DATA,dataViewer
.findListByProperty(ViewRiksdagenPolitician.class,
ViewRiksdagenPolitician_.activeParliament,
- true).size());
+ true).size() >= NUMBER_PARLIMENT_MEMBERS);
}
}
