@Test
public void testRulesCreation() throws Exception {

    // given
    File rulesDescriptor = new File("src/test/resources/rules." + fileExtension);
    // when
    Rules rules = factory.createRules(new FileReader(rulesDescriptor));
    // then
    assertThat(rules).hasSize(2);
    Iterator<Rule> iterator = rules.iterator();
    Rule rule = iterator.next();
    assertThat(rule).isNotNull();
    assertThat(rule.getName()).isEqualTo("adult rule");
    assertThat(rule.getDescription()).isEqualTo("when age is greater than 18, then mark as adult");
    assertThat(rule.getPriority()).isEqualTo(1);
    rule = iterator.next();
    assertThat(rule).isNotNull();
    assertThat(rule.getName()).isEqualTo("weather rule");
    assertThat(rule.getDescription()).isEqualTo("when it rains, then take an umbrella");
    assertThat(rule.getPriority()).isEqualTo(2);
}