本文整理了Java中org.assertj.core.api.ZonedDateTimeAssert
类的一些代码示例,展示了ZonedDateTimeAssert
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZonedDateTimeAssert
类的具体详情如下:
包路径:org.assertj.core.api.ZonedDateTimeAssert
类名称:ZonedDateTimeAssert
[英]Assertions for ZonedDateTime type from new Date & Time API introduced in Java 8.
[中]来自Java8中引入的新日期和时间API的ZonedDateTime类型断言。
代码示例来源:origin: joel-costigliola/assertj-core
/**
* Creates a new instance of <code>{@link ZonedDateTimeAssert}</code>.
*
* @param actual the actual value.
* @return the created assertion object.
*/
public static AbstractZonedDateTimeAssert<?> assertThat(ZonedDateTime actual) {
return new ZonedDateTimeAssert(actual);
}
代码示例来源:origin: commercetools/commercetools-jvm-sdk
soft.assertThat(updatedProject.getLanguages()).as("languages").isEqualTo(new_project_languages);
soft.assertThat(updatedProject.getLanguageLocales()).as("languages as locale").isEqualTo(new_project_locales);
soft.assertThat(updatedProject.getCreatedAt()).as("createdAt").isNotNull();
soft.assertThat(updatedProject.getCurrencies()).as("currencies").isEqualTo(new_project_currencies);
soft.assertThat(updatedProject.getCurrencyUnits()).as("currencies as unit").contains(USD);
代码示例来源:origin: RoboZonky/robozonky
@Test
void replacesWithSynthetic() {
SoftAssertions.assertSoftly(softly -> {
softly.assertThat(DateUtil.now()).isEqualTo(INSTANT);
softly.assertThat(DateUtil.localNow()).isEqualTo(LocalDateTime.ofInstant(INSTANT, Defaults.ZONE_ID));
softly.assertThat(DateUtil.offsetNow()).isEqualTo(OffsetDateTime.ofInstant(INSTANT, Defaults.ZONE_ID));
softly.assertThat(DateUtil.zonedNow()).isEqualTo(ZonedDateTime.ofInstant(INSTANT, Defaults.ZONE_ID));
});
}
代码示例来源:origin: commercetools/commercetools-jvm-sdk
@Test
public void execution() throws Exception {
final Project project = client().executeBlocking(ProjectGet.of());
softAssert(soft -> {
soft.assertThat(project.getKey()).isEqualTo(getSphereClientConfig().getProjectKey());
soft.assertThat(project.getName()).as("name").isNotEmpty();
soft.assertThat(project.getCountries()).as("countries").isNotEmpty();
soft.assertThat(project.getLanguages()).as("languages").contains("en");
soft.assertThat(project.getLanguageLocales()).as("languages as locale").contains(Locale.ENGLISH);
soft.assertThat(project.getCreatedAt()).as("createdAt").isNotNull();
soft.assertThat(project.getCurrencies()).as("currencies").contains("EUR");
soft.assertThat(project.getCurrencyUnits()).as("currencies as unit").contains(EUR);
soft.assertThat(project.getMessages().isEnabled()).isTrue();
//there is a test for trialUntil missing since some ci test projects don't possess a value for this field
});
}
}
代码示例来源:origin: commercetools/commercetools-jvm-sdk
s.assertThat(payment.getAmountPlanned()).as("planned").isEqualTo(totalAmount);
s.assertThat(payment.getAmountAuthorized()).as("authorized").isEqualTo(totalAmount);
s.assertThat(payment.getAuthorizedUntil()).isEqualTo(authorizedUntil);
s.assertThat(payment.getAmountPaid()).as("paid").isEqualTo(totalAmount);
s.assertThat(payment.getAmountRefunded()).as("refunded").isEqualTo(EURO_1);
s.assertThat(payment.getPaymentStatus()).isEqualTo(paymentStatus);
final Transaction transaction = payment.getTransactions().get(0);
s.assertThat(transaction.getTimestamp()).isEqualTo(transactionDraft.getTimestamp());
s.assertThat(transaction.getAmount()).isEqualTo(transactionDraft.getAmount());
s.assertThat(transaction.getInteractionId()).isEqualTo(transactionDraft.getInteractionId());
代码示例来源:origin: org.assertj/assertj-core
/**
* Creates a new instance of <code>{@link ZonedDateTimeAssert}</code>.
*
* @param actual the actual value.
* @return the created assertion object.
*/
@CheckReturnValue
public static AbstractZonedDateTimeAssert<?> assertThat(ZonedDateTime actual) {
return new ZonedDateTimeAssert(actual);
}
代码示例来源:origin: commercetools/commercetools-jvm-sdk
@BeforeClass
@AfterClass
public static void resetProject() {
final Project project = client().executeBlocking(ProjectGet.of());
final ProjectUpdateCommand updateCommand = ProjectUpdateCommand.of(project, Arrays.asList(
ChangeName.of(PROJECT_NAME),
ChangeCurrencies.of(PROJECT_CURRENCIES),
ChangeCountries.of(PROJECT_COUNTRIES),
ChangeLanguages.of(PROJECT_LANGUAGES),
ChangeMessagesEnabled.of(PROJECT_MESSAGES_ENABLED),
SetShippingRateInputType.ofUnset()
));
final Project updatedProject = client().executeBlocking(updateCommand);
softAssert(soft -> {
soft.assertThat(updatedProject.getKey()).isEqualTo(getSphereClientConfig().getProjectKey());
soft.assertThat(updatedProject.getName()).as("name").isEqualTo(PROJECT_NAME);
soft.assertThat(updatedProject.getCountries()).as("countries").isEqualTo(PROJECT_COUNTRIES);
soft.assertThat(updatedProject.getLanguages()).as("languages").isEqualTo(PROJECT_LANGUAGES);
soft.assertThat(updatedProject.getLanguageLocales()).as("languages as locale").isEqualTo(PROJECT_LOCALES);
soft.assertThat(updatedProject.getCreatedAt()).as("createdAt").isNotNull();
soft.assertThat(updatedProject.getCurrencies()).as("currencies").isEqualTo(PROJECT_CURRENCIES);
soft.assertThat(updatedProject.getCurrencyUnits()).as("currencies as unit").contains(EUR);
soft.assertThat(updatedProject.getMessages().isEnabled()).isEqualTo(PROJECT_MESSAGES_ENABLED);
soft.assertThat(updatedProject.getShippingRateInputType()).isNull();
});
}
代码示例来源:origin: org.assertj/assertj-core-java8
/**
* Creates a new instance of <code>{@link ZonedDateTimeAssert}</code>.
*
* @param actual the actual value.
* @return the created assertion object.
*/
public static AbstractZonedDateTimeAssert<?> assertThat(ZonedDateTime date) {
return new ZonedDateTimeAssert(date);
}
内容来源于网络,如有侵权,请联系作者删除!