Example #1
0
  @Test
  public void lackOfKonvGroupSettings() {

    settings.shrinkKonvGroupScope(konvGroup);

    assertFalse(settings.hasKonvGroupSettings());
  }
Example #2
0
  @Test
  public void expandKonvScope() {

    settings.expandKonvScope(konv);

    assertTrue(settings.contains(konv));
  }
Example #3
0
  @Test
  public void shouldExpandDecreeSequenceGroupScope() {

    settings.expandDecreeSequenceGroupScope(group);

    assertTrue(settings.contains(group));
  }
Example #4
0
  @Test
  public void shrinkKonvScope() {
    settings.expandKonvScope(konv);

    settings.shrinkKonvScope(konv);

    assertFalse(settings.contains(konv));
  }
Example #5
0
  @Test
  public void shouldShrinkDecreeSequenceGroupScope() {

    settings.expandDecreeSequenceGroupScope(group);
    settings.shrinkDecreeSequenceGroupScope(group);

    assertFalse(settings.contains(group));
  }
Example #6
0
  @Test
  public void defineTheScopeOfReportInputParams() {

    List<DecreeSequence> decreeSequences = settings.getDecreeSequences();
    List<GeoArea> geoAreas = settings.getGeoAreas();
    List<KonvGroup> konvGroups = settings.getKonvGroups();

    assertThat(decreeSequences, hasItem(decreeSequence));
    assertThat(geoAreas, hasItem(geoArea));
    assertThat(konvGroups, hasItem(konvGroup));
  }
Example #7
0
  @Test
  public void shouldReturnInputKonvGroupListWhenAnEmptyKonvGroupScopeIsFound() {

    settings.shrinkKonvGroupScope(konvGroup);
    assertThat(settings.hasKonvGroupSettings(), is(Boolean.FALSE));

    final KonvGroup inputKonvGroup = mock(KonvGroup.class);

    List<KonvGroup> selected = settings.chooseOver(Arrays.asList(inputKonvGroup));

    assertThat(selected, hasItems(inputKonvGroup));
    assertThat(selected, not(hasItems(konvGroup)));
  }
Example #8
0
  @Test
  public void twoSettingsShouldBeEqualIfTheyShareSameCode() {

    ReportSettings other = new ReportSettings(settings.getCode());

    assertThat(other, is(equalTo(settings)));
  }
Example #9
0
  @Test
  public void shouldReturnNonEmptyKonvGroupScopeWhenChoosingOverAnEmptyListOfInputKonvGroups() {

    List<KonvGroup> selected = settings.chooseOver(Collections.EMPTY_LIST);

    assertThat(selected, hasItems(konvGroup));
    assertThat(selected.size(), is(1));
  }
Example #10
0
  @Test
  public void shouldReturnNonEmptyKonvGroupScopeWhenChoosingOverNonEmptyListOfInputKonvGroups() {
    final KonvGroup inputKonvGroup = mock(KonvGroup.class);

    List<KonvGroup> selected = settings.chooseOver(Arrays.asList(inputKonvGroup));

    assertThat(selected, hasItems(konvGroup));
    assertThat(selected, not(hasItems(inputKonvGroup)));
  }
Example #11
0
  @Test
  public void aReportSettingsShouldNotContainAkonvWhenItIsNotPresentInItsKonvsCollection()
      throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException {

    Field konvsField = ReportSettings.class.getDeclaredField("konvs");
    konvsField.setAccessible(true);
    final ArrayList<Konv> konvs = new ArrayList<>();
    konvsField.set(settings, konvs);

    assertFalse(settings.contains(konv));
  }
Example #12
0
  @Test
  public void shrinkReportSettingsScopes() {

    settings.shrinkDecreeSequenceScope(decreeSequence);
    settings.shrinkGeoAreaScope(geoArea);
    settings.shrinkKonvGroupScope(konvGroup);

    assertThat(settings.getDecreeSequences(), not(hasItem(decreeSequence)));
    assertThat(settings.getGeoAreas(), not(hasItem(geoArea)));
    assertThat(settings.getKonvGroups(), not(hasItem(konvGroup)));
  }
Example #13
0
  @Test
  public void hasKonvGroupSettings() {

    assertTrue(settings.hasKonvGroupSettings());
  }