Skip to content

Commit

Permalink
Module fix, new unit test.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemmermann committed Oct 3, 2022
1 parent 9e2ab55 commit 1c62a57
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 8 deletions.
2 changes: 0 additions & 2 deletions CalendarFXView/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
exports impl.com.calendarfx.view.util;

opens com.calendarfx.view;
opens com.calendarfx.view.resources;
opens impl.com.calendarfx.view.resources;
opens com.calendarfx.model;
opens impl.com.calendarfx.view;
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertThat;
import static org.hamcrest.MatcherAssert.assertThat;

public class CalendarTest {

private Calendar calendar = new Calendar();
private final Calendar calendar = new Calendar();
private Entry<String> recurrenceSourceEntry;
private Entry<String> recurrence;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assert.assertThat;
import static org.hamcrest.MatcherAssert.assertThat;

public class EntryTest {

private Entry<String> entry = new Entry<>();
private final Entry<String> entry = new Entry<>();

private Calendar calendar = new Calendar();
private final Calendar calendar = new Calendar();

@Before
public void setup() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@
import org.junit.Before;
import org.junit.Test;

import java.time.Duration;
import java.time.LocalDate;
import java.time.LocalTime;
import java.time.ZoneId;

import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
import static org.hamcrest.MatcherAssert.assertThat;

public class IntervalTest {

Expand Down Expand Up @@ -132,6 +133,19 @@ public void shouldChangeEndTime() {
assertThat(interval.getEndTime(), is(equalTo(newTime)));
}

@Test
public void shouldChangeDuration() {
// given
Duration newDuration = Duration.ofMinutes(30);

// when
interval = interval.withDuration(newDuration);

// then
assertThat(interval.getDuration(), is(equalTo(newDuration)));
assertThat(interval.getEndTime(), is(equalTo(interval.getStartTime().plus(newDuration))));
}

@Test
public void shouldChangeZoneId() {
// given
Expand Down
4 changes: 4 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,10 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<!-- Activate the use of TCP to transmit events to the plugin -->
<forkNode implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory"/>
</configuration>
</plugin>
</plugins>
</build>
Expand Down

0 comments on commit 1c62a57

Please sign in to comment.