本文整理汇总了Java中org.threeten.bp.LocalDateTime.plusMinutes方法的典型用法代码示例。如果您正苦于以下问题:Java LocalDateTime.plusMinutes方法的具体用法?Java LocalDateTime.plusMinutes怎么用?Java LocalDateTime.plusMinutes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.threeten.bp.LocalDateTime
的用法示例。
在下文中一共展示了LocalDateTime.plusMinutes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: should_remove_previous_session_when_adding_a_new_one_for_the_same_slot_time
import org.threeten.bp.LocalDateTime; //导入方法依赖的package包/类
@Test
public void should_remove_previous_session_when_adding_a_new_one_for_the_same_slot_time() {
// Given
LocalDateTime now = LocalDateTime.now();
Map<LocalDateTime, Integer> map = new HashMap<>();
map.put(now, 1);
memory.setSelectedSessions(map);
Session toAdd = new Session(3, null, null, null, null, now, now.plusMinutes(30));
// When
assertThat(memory.get(now)).isEqualTo(1);
memory.toggleSessionState(toAdd, true);
// Then
assertThat(memory.get(now)).isEqualTo(3);
}
示例2: should_restore_from_parcelable
import org.threeten.bp.LocalDateTime; //导入方法依赖的package包/类
@Test
public void should_restore_from_parcelable() {
// Given
List<Speaker> speakers = singletonList(new Speaker(1, null, null, null, null, null, null, null));
LocalDateTime fromTime = LocalDateTime.now().minusDays(1);
LocalDateTime toTime = fromTime.plusMinutes(45);
Session session = new Session(42, "ROOM1", speakers, "TITLE", "DESCRIPTION", fromTime, toTime);
// When
Parcel parcel = Parcel.obtain();
session.writeToParcel(parcel, 0);
parcel.setDataPosition(0);
Session fromParcel = Session.CREATOR.createFromParcel(parcel);
// Then
assertThat(fromParcel.getId()).isEqualTo(42);
assertThat(fromParcel.getRoom()).isEqualTo("ROOM1");
assertThat(fromParcel.getSpeakers()).hasSize(1);
assertThat(fromParcel.getTitle()).isEqualTo("TITLE");
assertThat(fromParcel.getDescription()).isEqualTo("DESCRIPTION");
assertThat(fromParcel.getFromTime()).isEqualTo(fromTime);
assertThat(fromParcel.getToTime()).isEqualTo(toTime);
}