本文整理匯總了Java中org.junit.jupiter.api.Assertions.assertNotNull方法的典型用法代碼示例。如果您正苦於以下問題:Java Assertions.assertNotNull方法的具體用法?Java Assertions.assertNotNull怎麽用?Java Assertions.assertNotNull使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.junit.jupiter.api.Assertions
的用法示例。
在下文中一共展示了Assertions.assertNotNull方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getValue
import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@ParameterizedTest
@MethodSource("valuesStream")
void getValue(final Value value) {
for (int i = 0; i < value.size(); i++) {
Assertions.assertNotNull(value.getValue(i));
}
}
示例2: canFindTemplates
import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
public void canFindTemplates() throws Exception {
TestHTMLReportWriter writer = new TestHTMLReportWriter("");
try (InputStream template = writer.getTemplate("index.html")) {
Assertions.assertNotNull(template);
} catch (IOException e) {
throw e;
}
}
示例3: getSortNullFirst
import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
void getSortNullFirst() {
final SortField sortFieldNullFirstAscInt = intSortValue.getSortFieldNullFirst(SortOrder.ASC);
final SortField sortFieldNullFirstDescInt = intSortValue.getSortFieldNullFirst(SortOrder.DESC);
final SortField sortFieldNullFirstAscString = stringSortValue.getSortFieldNullFirst(SortOrder.ASC);
final SortField sortFieldNullFirstDescString = stringSortValue.getSortFieldNullFirst(SortOrder.DESC);
Assertions.assertNotNull(sortFieldNullFirstAscInt);
Assertions.assertNotNull(sortFieldNullFirstDescInt);
Assertions.assertNotNull(sortFieldNullFirstAscString);
Assertions.assertNotNull(sortFieldNullFirstDescString);
}
示例4: testClassConstructingWithArgs
import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
public void testClassConstructingWithArgs() throws Exception {
Class<TestClassTwo> testClass = TestClassTwo.class;
ClassWrapper<TestClassTwo> cw = Reflect.wrapClass(testClass)
.construct(of("foo"));
Assertions.assertNotNull(cw.getClassInstance(), "Class instance shouldn't be null!");
TestClassTwo inst = cw.getClassInstance();
Assertions.assertEquals("foo", inst.getA());
}
示例5: ofDateTimeIsSingleton
import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
void ofDateTimeIsSingleton() {
final FilterParser<LocalDateTime> filterParser1 = FilterParser.ofDateTime();
final FilterParser<LocalDateTime> filterParser2 = FilterParser.ofDateTime();
Assertions.assertNotNull(filterParser1);
Assertions.assertSame(filterParser1, filterParser2);
}
示例6: of2KeyParser
import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
void of2KeyParser() {
final FilterValue filterValue2 =
Filter.of(
KeyParsers.of("key", val1 -> "value", "key2", val2 -> "value"),
(value1, value2) -> DSL.trueCondition());
Assertions.assertEquals(2, filterValue2.size());
Assertions.assertNotNull(filterValue2);
}
示例7: ofIntIsSingleton
import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
void ofIntIsSingleton() {
final FilterParser<Integer> filterParser1 = FilterParser.ofInt();
final FilterParser<Integer> filterParser2 = FilterParser.ofInt();
Assertions.assertNotNull(filterParser1);
Assertions.assertSame(filterParser1, filterParser2);
}
示例8: testParametersNeedExtraAnnotation
import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
@ExtendWith(CustomExtension.class)
public void testParametersNeedExtraAnnotation(@Default Foo foo, Bar bar, @MyQualifier BeanWithQualifier bean) {
// Bar should be resolved by another extension
Assertions.assertNotNull(bar);
Assertions.assertEquals(CustomExtension.class.getSimpleName(), bar.ping());
// Foo should be resolved as usual
Assertions.assertNotNull(foo);
Assertions.assertEquals(Foo.class.getSimpleName(), foo.ping());
// BeanWithQualifier should be resolved
Assertions.assertNotNull(bean);
Assertions.assertEquals(BeanWithQualifier.class.getSimpleName(), bean.ping());
}
示例9: of4KeyParser
import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
void of4KeyParser() {
final FilterValue filterValue4 = Filter.of(
KeyParsers.of("key", val1 -> "value", "key2", val2 -> "value", "key3", val3 -> "value", "key4", val4 -> "value"),
value -> DSL.trueCondition());
Assertions.assertEquals(4, filterValue4.size());
Assertions.assertNotNull(filterValue4);
}
示例10: testClassFinding
import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
public void testClassFinding() throws Exception {
Class<?> testClass = TestClassOne.class;
String className = testClass.getName();
ClassWrapper<?> cw = Reflect.getClass(className).orElse(null);
Assertions.assertNotNull(cw, "Class wrapper shouldn't be null!");
Assertions.assertEquals(testClass, cw.getWrappedClass(), "Classes weren't equal!");
Assertions.assertNull(cw.getClassInstance(), "Class instance shouldn't be set!");
}
示例11: getKeyParser5
import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
void getKeyParser5() {
final KeyParser5 keyParser = filterValue5.getKeyParser5();
Assertions.assertNotNull(keyParser);
}
示例12: getTestJdbcUrl
import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Nonnull
protected static String getTestJdbcUrl() {
String jdbc = System.getenv(TEST_JDBC_URL_ENV);
Assertions.assertNotNull(jdbc, String.format("Jdbc test url %s environment variable is null", TEST_JDBC_URL_ENV));
return jdbc;
}
示例13: description
import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
void description() {
Assertions.assertNotNull(command.description());
Assertions.assertTrue(command.description().length() == 0);
}
示例14: testLoadJ3o
import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
void testLoadJ3o() {
final AssetManager assetManager = getApplication().getAssetManager();
final Spatial model = assetManager.loadModel("com/ss/editor/extension/testCube.j3o");
Assertions.assertNotNull(model);
}
示例15: of1
import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
void of1() {
final FilterValue filterValue1 = Filter.of("key", val -> "value", value -> DSL.trueCondition());
Assertions.assertEquals(1, filterValue1.size());
Assertions.assertNotNull(filterValue1);
}