本文整理汇总了Java中org.assertj.core.util.Objects类的典型用法代码示例。如果您正苦于以下问题:Java Objects类的具体用法?Java Objects怎么用?Java Objects使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Objects类属于org.assertj.core.util包,在下文中一共展示了Objects类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: hasName
import org.assertj.core.util.Objects; //导入依赖的package包/类
/**
* Verifies that the actual Hoge's name is equal to the given one.
* @param name the given name to compare the actual Hoge's name to.
* @return this assertion object.
* @throws AssertionError - if the actual Hoge's name is not equal to the given one.
*/
public HogeAssert hasName(String name) {
// check that actual Hoge we want to make assertions on is not null.
isNotNull();
// overrides the default error message with a more explicit one
String assertjErrorMessage = "\nExpecting name of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>";
// null safe check
String actualName = actual.getName();
if (!Objects.areEqual(actualName, name)) {
failWithMessage(assertjErrorMessage, actual, name, actualName);
}
// return the current assertion for method chaining
return this;
}
开发者ID:opengl-8080,项目名称:assertjGen-gradle-plugin,代码行数:23,代码来源:HogeAssert.java
示例2: hasName
import org.assertj.core.util.Objects; //导入依赖的package包/类
/**
* Verifies that the actual PlayerRowSimple's name is equal to the given one.
* @param name the given name to compare the actual PlayerRowSimple's name to.
* @return this assertion object.
* @throws AssertionError - if the actual PlayerRowSimple's name is not equal to the given one.
*/
public PlayerRowSimpleAssert hasName(String name) {
// check that actual PlayerRowSimple we want to make assertions on is not null.
isNotNull();
// overrides the default error message with a more explicit one
String assertjErrorMessage = "\nExpecting name of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>";
// null safe check
String actualName = actual.getName();
if (!Objects.areEqual(actualName, name)) {
failWithMessage(assertjErrorMessage, actual, name, actualName);
}
// return the current assertion for method chaining
return this;
}
开发者ID:casid,项目名称:mazebert-ladder,代码行数:23,代码来源:PlayerRowSimpleAssert.java
示例3: hasName
import org.assertj.core.util.Objects; //导入依赖的package包/类
/**
* Verifies that the actual Item's name is equal to the given one.
* @param name the given name to compare the actual Item's name to.
* @return this assertion object.
* @throws AssertionError - if the actual Item's name is not equal to the given one.
*/
public ItemAssert hasName(String name) {
// check that actual Item we want to make assertions on is not null.
isNotNull();
// overrides the default error message with a more explicit one
String assertjErrorMessage = "\nExpecting name of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>";
// null safe check
String actualName = actual.getName();
if (!Objects.areEqual(actualName, name)) {
failWithMessage(assertjErrorMessage, actual, name, actualName);
}
// return the current assertion for method chaining
return this;
}
开发者ID:casid,项目名称:mazebert-ladder,代码行数:23,代码来源:ItemAssert.java
示例4: hasSinceVersion
import org.assertj.core.util.Objects; //导入依赖的package包/类
/**
* Verifies that the actual Item's sinceVersion is equal to the given one.
* @param sinceVersion the given sinceVersion to compare the actual Item's sinceVersion to.
* @return this assertion object.
* @throws AssertionError - if the actual Item's sinceVersion is not equal to the given one.
*/
public ItemAssert hasSinceVersion(String sinceVersion) {
// check that actual Item we want to make assertions on is not null.
isNotNull();
// overrides the default error message with a more explicit one
String assertjErrorMessage = "\nExpecting sinceVersion of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>";
// null safe check
String actualSinceVersion = actual.getSinceVersion();
if (!Objects.areEqual(actualSinceVersion, sinceVersion)) {
failWithMessage(assertjErrorMessage, actual, sinceVersion, actualSinceVersion);
}
// return the current assertion for method chaining
return this;
}
开发者ID:casid,项目名称:mazebert-ladder,代码行数:23,代码来源:ItemAssert.java
示例5: hasOffer
import org.assertj.core.util.Objects; //导入依赖的package包/类
/**
* Verifies that the actual BlackMarket's offer is equal to the given one.
* @param offer the given offer to compare the actual BlackMarket's offer to.
* @return this assertion object.
* @throws AssertionError - if the actual BlackMarket's offer is not equal to the given one.
*/
public BlackMarketAssert hasOffer(BlackMarketOffer offer) {
// check that actual BlackMarket we want to make assertions on is not null.
isNotNull();
// overrides the default error message with a more explicit one
String assertjErrorMessage = "\nExpecting offer of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>";
// null safe check
BlackMarketOffer actualOffer = actual.getOffer();
if (!Objects.areEqual(actualOffer, offer)) {
failWithMessage(assertjErrorMessage, actual, offer, actualOffer);
}
// return the current assertion for method chaining
return this;
}
开发者ID:casid,项目名称:mazebert-ladder,代码行数:23,代码来源:BlackMarketAssert.java
示例6: hasName
import org.assertj.core.util.Objects; //导入依赖的package包/类
/**
* Verifies that the actual PlayerRow's name is equal to the given one.
* @param name the given name to compare the actual PlayerRow's name to.
* @return this assertion object.
* @throws AssertionError - if the actual PlayerRow's name is not equal to the given one.
*/
public PlayerRowAssert hasName(String name) {
// check that actual PlayerRow we want to make assertions on is not null.
isNotNull();
// overrides the default error message with a more explicit one
String assertjErrorMessage = "\nExpecting name of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>";
// null safe check
String actualName = actual.getName();
if (!Objects.areEqual(actualName, name)) {
failWithMessage(assertjErrorMessage, actual, name, actualName);
}
// return the current assertion for method chaining
return this;
}
开发者ID:casid,项目名称:mazebert-ladder,代码行数:23,代码来源:PlayerRowAssert.java
示例7: hasDetails
import org.assertj.core.util.Objects; //导入依赖的package包/类
/**
* Verifies that the actual VersionInfo's details is equal to the given one.
* @param details the given details to compare the actual VersionInfo's details to.
* @return this assertion object.
* @throws AssertionError - if the actual VersionInfo's details is not equal to the given one.
*/
public VersionInfoAssert hasDetails(String details) {
// check that actual VersionInfo we want to make assertions on is not null.
isNotNull();
// overrides the default error message with a more explicit one
String assertjErrorMessage = "\nExpecting details of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>";
// null safe check
String actualDetails = actual.getDetails();
if (!Objects.areEqual(actualDetails, details)) {
failWithMessage(assertjErrorMessage, actual, details, actualDetails);
}
// return the current assertion for method chaining
return this;
}
开发者ID:casid,项目名称:mazebert-ladder,代码行数:23,代码来源:VersionInfoAssert.java
示例8: hasStore
import org.assertj.core.util.Objects; //导入依赖的package包/类
/**
* Verifies that the actual VersionInfo's store is equal to the given one.
* @param store the given store to compare the actual VersionInfo's store to.
* @return this assertion object.
* @throws AssertionError - if the actual VersionInfo's store is not equal to the given one.
*/
public VersionInfoAssert hasStore(String store) {
// check that actual VersionInfo we want to make assertions on is not null.
isNotNull();
// overrides the default error message with a more explicit one
String assertjErrorMessage = "\nExpecting store of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>";
// null safe check
String actualStore = actual.getStore();
if (!Objects.areEqual(actualStore, store)) {
failWithMessage(assertjErrorMessage, actual, store, actualStore);
}
// return the current assertion for method chaining
return this;
}
开发者ID:casid,项目名称:mazebert-ladder,代码行数:23,代码来源:VersionInfoAssert.java
示例9: hasUrl
import org.assertj.core.util.Objects; //导入依赖的package包/类
/**
* Verifies that the actual VersionInfo's url is equal to the given one.
* @param url the given url to compare the actual VersionInfo's url to.
* @return this assertion object.
* @throws AssertionError - if the actual VersionInfo's url is not equal to the given one.
*/
public VersionInfoAssert hasUrl(String url) {
// check that actual VersionInfo we want to make assertions on is not null.
isNotNull();
// overrides the default error message with a more explicit one
String assertjErrorMessage = "\nExpecting url of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>";
// null safe check
String actualUrl = actual.getUrl();
if (!Objects.areEqual(actualUrl, url)) {
failWithMessage(assertjErrorMessage, actual, url, actualUrl);
}
// return the current assertion for method chaining
return this;
}
开发者ID:casid,项目名称:mazebert-ladder,代码行数:23,代码来源:VersionInfoAssert.java
示例10: hasVersion
import org.assertj.core.util.Objects; //导入依赖的package包/类
/**
* Verifies that the actual VersionInfo's version is equal to the given one.
* @param version the given version to compare the actual VersionInfo's version to.
* @return this assertion object.
* @throws AssertionError - if the actual VersionInfo's version is not equal to the given one.
*/
public VersionInfoAssert hasVersion(String version) {
// check that actual VersionInfo we want to make assertions on is not null.
isNotNull();
// overrides the default error message with a more explicit one
String assertjErrorMessage = "\nExpecting version of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>";
// null safe check
String actualVersion = actual.getVersion();
if (!Objects.areEqual(actualVersion, version)) {
failWithMessage(assertjErrorMessage, actual, version, actualVersion);
}
// return the current assertion for method chaining
return this;
}
开发者ID:casid,项目名称:mazebert-ladder,代码行数:23,代码来源:VersionInfoAssert.java
示例11: hasName
import org.assertj.core.util.Objects; //导入依赖的package包/类
/**
* Verifies that the actual Hero's name is equal to the given one.
* @param name the given name to compare the actual Hero's name to.
* @return this assertion object.
* @throws AssertionError - if the actual Hero's name is not equal to the given one.
*/
public HeroAssert hasName(String name) {
// check that actual Hero we want to make assertions on is not null.
isNotNull();
// overrides the default error message with a more explicit one
String assertjErrorMessage = "\nExpecting name of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>";
// null safe check
String actualName = actual.getName();
if (!Objects.areEqual(actualName, name)) {
failWithMessage(assertjErrorMessage, actual, name, actualName);
}
// return the current assertion for method chaining
return this;
}
开发者ID:casid,项目名称:mazebert-ladder,代码行数:23,代码来源:HeroAssert.java
示例12: hasSinceVersion
import org.assertj.core.util.Objects; //导入依赖的package包/类
/**
* Verifies that the actual Hero's sinceVersion is equal to the given one.
* @param sinceVersion the given sinceVersion to compare the actual Hero's sinceVersion to.
* @return this assertion object.
* @throws AssertionError - if the actual Hero's sinceVersion is not equal to the given one.
*/
public HeroAssert hasSinceVersion(String sinceVersion) {
// check that actual Hero we want to make assertions on is not null.
isNotNull();
// overrides the default error message with a more explicit one
String assertjErrorMessage = "\nExpecting sinceVersion of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>";
// null safe check
String actualSinceVersion = actual.getSinceVersion();
if (!Objects.areEqual(actualSinceVersion, sinceVersion)) {
failWithMessage(assertjErrorMessage, actual, sinceVersion, actualSinceVersion);
}
// return the current assertion for method chaining
return this;
}
开发者ID:casid,项目名称:mazebert-ladder,代码行数:23,代码来源:HeroAssert.java
示例13: hasName
import org.assertj.core.util.Objects; //导入依赖的package包/类
/**
* Verifies that the actual PlayerBonusTime's name is equal to the given one.
* @param name the given name to compare the actual PlayerBonusTime's name to.
* @return this assertion object.
* @throws AssertionError - if the actual PlayerBonusTime's name is not equal to the given one.
*/
public PlayerBonusTimeAssert hasName(String name) {
// check that actual PlayerBonusTime we want to make assertions on is not null.
isNotNull();
// overrides the default error message with a more explicit one
String assertjErrorMessage = "\nExpecting name of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>";
// null safe check
String actualName = actual.getName();
if (!Objects.areEqual(actualName, name)) {
failWithMessage(assertjErrorMessage, actual, name, actualName);
}
// return the current assertion for method chaining
return this;
}
开发者ID:casid,项目名称:mazebert-ladder,代码行数:23,代码来源:PlayerBonusTimeAssert.java
示例14: hasName
import org.assertj.core.util.Objects; //导入依赖的package包/类
/**
* Verifies that the actual Supporter's name is equal to the given one.
* @param name the given name to compare the actual Supporter's name to.
* @return this assertion object.
* @throws AssertionError - if the actual Supporter's name is not equal to the given one.
*/
public SupporterAssert hasName(String name) {
// check that actual Supporter we want to make assertions on is not null.
isNotNull();
// overrides the default error message with a more explicit one
String assertjErrorMessage = "\nExpecting name of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>";
// null safe check
String actualName = actual.getName();
if (!Objects.areEqual(actualName, name)) {
failWithMessage(assertjErrorMessage, actual, name, actualName);
}
// return the current assertion for method chaining
return this;
}
开发者ID:casid,项目名称:mazebert-ladder,代码行数:23,代码来源:SupporterAssert.java
示例15: hasSinceVersion
import org.assertj.core.util.Objects; //导入依赖的package包/类
/**
* Verifies that the actual Quest's sinceVersion is equal to the given one.
* @param sinceVersion the given sinceVersion to compare the actual Quest's sinceVersion to.
* @return this assertion object.
* @throws AssertionError - if the actual Quest's sinceVersion is not equal to the given one.
*/
public QuestAssert hasSinceVersion(String sinceVersion) {
// check that actual Quest we want to make assertions on is not null.
isNotNull();
// overrides the default error message with a more explicit one
String assertjErrorMessage = "\nExpecting sinceVersion of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>";
// null safe check
String actualSinceVersion = actual.getSinceVersion();
if (!Objects.areEqual(actualSinceVersion, sinceVersion)) {
failWithMessage(assertjErrorMessage, actual, sinceVersion, actualSinceVersion);
}
// return the current assertion for method chaining
return this;
}
开发者ID:casid,项目名称:mazebert-ladder,代码行数:23,代码来源:QuestAssert.java
示例16: hasName
import org.assertj.core.util.Objects; //导入依赖的package包/类
/**
* Verifies that the actual Potion's name is equal to the given one.
* @param name the given name to compare the actual Potion's name to.
* @return this assertion object.
* @throws AssertionError - if the actual Potion's name is not equal to the given one.
*/
public PotionAssert hasName(String name) {
// check that actual Potion we want to make assertions on is not null.
isNotNull();
// overrides the default error message with a more explicit one
String assertjErrorMessage = "\nExpecting name of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>";
// null safe check
String actualName = actual.getName();
if (!Objects.areEqual(actualName, name)) {
failWithMessage(assertjErrorMessage, actual, name, actualName);
}
// return the current assertion for method chaining
return this;
}
开发者ID:casid,项目名称:mazebert-ladder,代码行数:23,代码来源:PotionAssert.java
示例17: hasSinceVersion
import org.assertj.core.util.Objects; //导入依赖的package包/类
/**
* Verifies that the actual Potion's sinceVersion is equal to the given one.
* @param sinceVersion the given sinceVersion to compare the actual Potion's sinceVersion to.
* @return this assertion object.
* @throws AssertionError - if the actual Potion's sinceVersion is not equal to the given one.
*/
public PotionAssert hasSinceVersion(String sinceVersion) {
// check that actual Potion we want to make assertions on is not null.
isNotNull();
// overrides the default error message with a more explicit one
String assertjErrorMessage = "\nExpecting sinceVersion of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>";
// null safe check
String actualSinceVersion = actual.getSinceVersion();
if (!Objects.areEqual(actualSinceVersion, sinceVersion)) {
failWithMessage(assertjErrorMessage, actual, sinceVersion, actualSinceVersion);
}
// return the current assertion for method chaining
return this;
}
开发者ID:casid,项目名称:mazebert-ladder,代码行数:23,代码来源:PotionAssert.java
示例18: hasEmail
import org.assertj.core.util.Objects; //导入依赖的package包/类
/**
* Verifies that the actual Player's email is equal to the given one.
* @param email the given email to compare the actual Player's email to.
* @return this assertion object.
* @throws AssertionError - if the actual Player's email is not equal to the given one.
*/
public PlayerAssert hasEmail(String email) {
// check that actual Player we want to make assertions on is not null.
isNotNull();
// overrides the default error message with a more explicit one
String assertjErrorMessage = "\nExpecting email of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>";
// null safe check
String actualEmail = actual.getEmail();
if (!Objects.areEqual(actualEmail, email)) {
failWithMessage(assertjErrorMessage, actual, email, actualEmail);
}
// return the current assertion for method chaining
return this;
}
开发者ID:casid,项目名称:mazebert-ladder,代码行数:23,代码来源:PlayerAssert.java
示例19: hasKey
import org.assertj.core.util.Objects; //导入依赖的package包/类
/**
* Verifies that the actual Player's key is equal to the given one.
* @param key the given key to compare the actual Player's key to.
* @return this assertion object.
* @throws AssertionError - if the actual Player's key is not equal to the given one.
*/
public PlayerAssert hasKey(String key) {
// check that actual Player we want to make assertions on is not null.
isNotNull();
// overrides the default error message with a more explicit one
String assertjErrorMessage = "\nExpecting key of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>";
// null safe check
String actualKey = actual.getKey();
if (!Objects.areEqual(actualKey, key)) {
failWithMessage(assertjErrorMessage, actual, key, actualKey);
}
// return the current assertion for method chaining
return this;
}
开发者ID:casid,项目名称:mazebert-ladder,代码行数:23,代码来源:PlayerAssert.java
示例20: hasLastQuestCreation
import org.assertj.core.util.Objects; //导入依赖的package包/类
/**
* Verifies that the actual Player's lastQuestCreation is equal to the given one.
* @param lastQuestCreation the given lastQuestCreation to compare the actual Player's lastQuestCreation to.
* @return this assertion object.
* @throws AssertionError - if the actual Player's lastQuestCreation is not equal to the given one.
*/
public PlayerAssert hasLastQuestCreation(java.util.Date lastQuestCreation) {
// check that actual Player we want to make assertions on is not null.
isNotNull();
// overrides the default error message with a more explicit one
String assertjErrorMessage = "\nExpecting lastQuestCreation of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>";
// null safe check
java.util.Date actualLastQuestCreation = actual.getLastQuestCreation();
if (!Objects.areEqual(actualLastQuestCreation, lastQuestCreation)) {
failWithMessage(assertjErrorMessage, actual, lastQuestCreation, actualLastQuestCreation);
}
// return the current assertion for method chaining
return this;
}
开发者ID:casid,项目名称:mazebert-ladder,代码行数:23,代码来源:PlayerAssert.java
注:本文中的org.assertj.core.util.Objects类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论