org.assertj.core.api.Assertions.byLessThan()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(10.9k)|赞(0)|评价(0)|浏览(111)

本文整理了Java中org.assertj.core.api.Assertions.byLessThan()方法的一些代码示例,展示了Assertions.byLessThan()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Assertions.byLessThan()方法的具体详情如下:
包路径:org.assertj.core.api.Assertions
类名称:Assertions
方法名:byLessThan

Assertions.byLessThan介绍

[英]Assertions entry point for TemporalUnitOffset with strict less than condition to use with isCloseTo temporal assertions.

Typical usage :

LocalTime _07_10 = LocalTime.of(7, 10); 
LocalTime _07_12 = LocalTime.of(7, 12); 
assertThat(_07_10).isCloseTo(_07_12, byLessThan(5, ChronoUnit.MINUTES));

[中]带有严格小于条件的TemporalUnitOffset的断言入口点,用于isCloseTo时态断言。
典型用法:

LocalTime _07_10 = LocalTime.of(7, 10); 
LocalTime _07_12 = LocalTime.of(7, 12); 
assertThat(_07_10).isCloseTo(_07_12, byLessThan(5, ChronoUnit.MINUTES));

代码示例

代码示例来源:origin: org.assertj/assertj-core

/**
 * Alias for {@link #offset(Double)} to use with isCloseTo assertions.
 * <p>
 * Typical usage :
 * <pre><code class='java'> assertThat(8.1).isCloseTo(8.0, byLessThan(0.1));</code></pre>
 *
 * @param value the value of the offset.
 * @return the created {@code Offset}.
 * @throws NullPointerException if the given value is {@code null}.
 * @throws IllegalArgumentException if the given value is negative.
 * @since 3.9.0
 */
default Offset<Double> byLessThan(Double value) {
 return Assertions.byLessThan(value);
}

代码示例来源:origin: org.assertj/assertj-core

/**
 * Assertions entry point for BigDecimal {@link Offset} to use with isCloseTo assertions.
 * <p>
 * Typical usage :
 * <pre><code class='java'> assertThat(BigDecimal.TEN).isCloseTo(new BigDecimal("10.5"), byLessThan(BigDecimal.ONE));</code></pre>
 *
 * @param value the value of the offset.
 * @return the created {@code Offset}.
 * @throws NullPointerException if the given value is {@code null}.
 * @throws IllegalArgumentException if the given value is negative.
 * @since 3.9.0
 */
default Offset<BigDecimal> byLessThan(BigDecimal value) {
 return Assertions.byLessThan(value);
}

代码示例来源:origin: org.assertj/assertj-core

/**
 * Assertions entry point for BigInteger {@link Offset} to use with isCloseTo assertions.
 * <p>
 * Typical usage :
 * <pre><code class='java'> assertThat(BigInteger.TEN).isCloseTo(new BigInteger("11"), byLessThan(new BigInteger("2")));</code></pre>
 *
 * @param value the value of the offset.
 * @return the created {@code Offset}.
 * @throws NullPointerException if the given value is {@code null}.
 * @throws IllegalArgumentException if the given value is negative.
 * @since 3.9.0
 */
default Offset<BigInteger> byLessThan(BigInteger value) {
 return Assertions.byLessThan(value);
}

代码示例来源:origin: org.assertj/assertj-core

/**
 * Assertions entry point for {@link TemporalUnitOffset} with strict less than condition
 * to use with {@code isCloseTo} temporal assertions.
 * <p>
 * Typical usage :
 * <pre><code class='java'> LocalTime _07_10 = LocalTime.of(7, 10);
 * LocalTime _07_12 = LocalTime.of(7, 12);
 * assertThat(_07_10).isCloseTo(_07_12, byLessThan(5, ChronoUnit.MINUTES));</code></pre>
 *
 * @param value the value of the offset.
 * @param unit the {@link TemporalUnit} of the offset.
 * @return the created {@code Offset}.
 * @since 3.9.0
 */
default TemporalUnitOffset byLessThan(long value, TemporalUnit unit) {
 return Assertions.byLessThan(value, unit);
}

代码示例来源:origin: org.assertj/assertj-core

/**
 * Alias for {@link #offset(Float)} to use with isCloseTo assertions.
 * <p>
 * Typical usage :
 * <pre><code class='java'> assertThat(8.2f).isCloseTo(8.0f, byLessThan(0.2f));</code></pre>
 *
 * @param value the value of the offset.
 * @return the created {@code Offset}.
 * @throws NullPointerException if the given value is {@code null}.
 * @throws IllegalArgumentException if the given value is negative.
 * @since 3.9.0
 */
default Offset<Float> byLessThan(Float value) {
 return Assertions.byLessThan(value);
}

代码示例来源:origin: org.assertj/assertj-core

/**
 * Assertions entry point for Byte {@link Offset} to use with isCloseTo assertions.
 * <p>
 * Typical usage :
 * <pre><code class='java'> assertThat((byte) 10).isCloseTo((byte) 11, byLessThan((byte) 1));</code></pre>
 *
 * @param value the value of the offset.
 * @return the created {@code Offset}.
 * @throws NullPointerException if the given value is {@code null}.
 * @throws IllegalArgumentException if the given value is negative.
 * @since 3.9.0
 */
default Offset<Byte> byLessThan(Byte value) {
 return Assertions.byLessThan(value);
}

代码示例来源:origin: org.assertj/assertj-core

/**
 * Assertions entry point for Integer {@link Offset} to use with isCloseTo assertions.
 * <p>
 * Typical usage :
 * <pre><code class='java'> assertThat(10).isCloseTo(11, byLessThan(1));</code></pre>
 *
 * @param value the value of the offset.
 * @return the created {@code Offset}.
 * @throws NullPointerException if the given value is {@code null}.
 * @throws IllegalArgumentException if the given value is negative.
 * @since 3.9.0
 */
default Offset<Integer> byLessThan(Integer value) {
 return Assertions.byLessThan(value);
}

代码示例来源:origin: org.assertj/assertj-core

/**
 * Assertions entry point for Short {@link Offset} to use with isCloseTo assertions.
 * <p>
 * Typical usage :
 * <pre><code class='java'> assertThat(10).isCloseTo(11, byLessThan(1));</code></pre>
 *
 * @param value the value of the offset.
 * @return the created {@code Offset}.
 * @throws NullPointerException if the given value is {@code null}.
 * @throws IllegalArgumentException if the given value is negative.
 * @since 3.9.0
 */
default Offset<Short> byLessThan(Short value) {
 return Assertions.byLessThan(value);
}

代码示例来源:origin: org.assertj/assertj-core

/**
 * Assertions entry point for Long {@link Offset} to use with isCloseTo assertions.
 * <p>
 * Typical usage :
 * <pre><code class='java'> assertThat(5l).isCloseTo(7l, byLessThan(2l));</code></pre>
 *
 * @param value the value of the offset.
 * @return the created {@code Offset}.
 * @throws NullPointerException if the given value is {@code null}.
 * @throws IllegalArgumentException if the given value is negative.
 * @since 3.9.0
 */
default Offset<Long> byLessThan(Long value) {
 return Assertions.byLessThan(value);
}

代码示例来源:origin: joel-costigliola/assertj-core

/**
 * Alias for {@link #offset(Double)} to use with isCloseTo assertions.
 * <p>
 * Typical usage :
 * <pre><code class='java'> assertThat(8.1).isCloseTo(8.0, byLessThan(0.1));</code></pre>
 *
 * @param value the value of the offset.
 * @return the created {@code Offset}.
 * @throws NullPointerException if the given value is {@code null}.
 * @throws IllegalArgumentException if the given value is negative.
 * @since 3.9.0
 */
default Offset<Double> byLessThan(Double value) {
 return Assertions.byLessThan(value);
}

代码示例来源:origin: joel-costigliola/assertj-core

/**
 * Assertions entry point for BigDecimal {@link Offset} to use with isCloseTo assertions.
 * <p>
 * Typical usage :
 * <pre><code class='java'> assertThat(BigDecimal.TEN).isCloseTo(new BigDecimal("10.5"), byLessThan(BigDecimal.ONE));</code></pre>
 *
 * @param value the value of the offset.
 * @return the created {@code Offset}.
 * @throws NullPointerException if the given value is {@code null}.
 * @throws IllegalArgumentException if the given value is negative.
 * @since 3.9.0
 */
default Offset<BigDecimal> byLessThan(BigDecimal value) {
 return Assertions.byLessThan(value);
}

代码示例来源:origin: joel-costigliola/assertj-core

/**
 * Assertions entry point for Long {@link Offset} to use with isCloseTo assertions.
 * <p>
 * Typical usage :
 * <pre><code class='java'> assertThat(5l).isCloseTo(7l, byLessThan(2l));</code></pre>
 *
 * @param value the value of the offset.
 * @return the created {@code Offset}.
 * @throws NullPointerException if the given value is {@code null}.
 * @throws IllegalArgumentException if the given value is negative.
 * @since 3.9.0
 */
default Offset<Long> byLessThan(Long value) {
 return Assertions.byLessThan(value);
}

代码示例来源:origin: joel-costigliola/assertj-core

/**
 * Alias for {@link #offset(Float)} to use with isCloseTo assertions.
 * <p>
 * Typical usage :
 * <pre><code class='java'> assertThat(8.2f).isCloseTo(8.0f, byLessThan(0.2f));</code></pre>
 *
 * @param value the value of the offset.
 * @return the created {@code Offset}.
 * @throws NullPointerException if the given value is {@code null}.
 * @throws IllegalArgumentException if the given value is negative.
 * @since 3.9.0
 */
default Offset<Float> byLessThan(Float value) {
 return Assertions.byLessThan(value);
}

代码示例来源:origin: joel-costigliola/assertj-core

/**
 * Assertions entry point for BigInteger {@link Offset} to use with isCloseTo assertions.
 * <p>
 * Typical usage :
 * <pre><code class='java'> assertThat(BigInteger.TEN).isCloseTo(new BigInteger("11"), byLessThan(new BigInteger("2")));</code></pre>
 *
 * @param value the value of the offset.
 * @return the created {@code Offset}.
 * @throws NullPointerException if the given value is {@code null}.
 * @throws IllegalArgumentException if the given value is negative.
 * @since 3.9.0
 */
default Offset<BigInteger> byLessThan(BigInteger value) {
 return Assertions.byLessThan(value);
}

代码示例来源:origin: joel-costigliola/assertj-core

/**
 * Assertions entry point for Short {@link Offset} to use with isCloseTo assertions.
 * <p>
 * Typical usage :
 * <pre><code class='java'> assertThat(10).isCloseTo(11, byLessThan(1));</code></pre>
 *
 * @param value the value of the offset.
 * @return the created {@code Offset}.
 * @throws NullPointerException if the given value is {@code null}.
 * @throws IllegalArgumentException if the given value is negative.
 * @since 3.9.0
 */
default Offset<Short> byLessThan(Short value) {
 return Assertions.byLessThan(value);
}

代码示例来源:origin: joel-costigliola/assertj-core

/**
 * Assertions entry point for {@link TemporalUnitOffset} with strict less than condition
 * to use with {@code isCloseTo} temporal assertions.
 * <p>
 * Typical usage :
 * <pre><code class='java'> LocalTime _07_10 = LocalTime.of(7, 10);
 * LocalTime _07_12 = LocalTime.of(7, 12);
 * assertThat(_07_10).isCloseTo(_07_12, byLessThan(5, ChronoUnit.MINUTES));</code></pre>
 *
 * @param value the value of the offset.
 * @param unit the {@link TemporalUnit} of the offset.
 * @return the created {@code Offset}.
 * @since 3.9.0
 */
default TemporalUnitOffset byLessThan(long value, TemporalUnit unit) {
 return Assertions.byLessThan(value, unit);
}

代码示例来源:origin: joel-costigliola/assertj-core

/**
 * Assertions entry point for Byte {@link Offset} to use with isCloseTo assertions.
 * <p>
 * Typical usage :
 * <pre><code class='java'> assertThat((byte) 10).isCloseTo((byte) 11, byLessThan((byte) 1));</code></pre>
 *
 * @param value the value of the offset.
 * @return the created {@code Offset}.
 * @throws NullPointerException if the given value is {@code null}.
 * @throws IllegalArgumentException if the given value is negative.
 * @since 3.9.0
 */
default Offset<Byte> byLessThan(Byte value) {
 return Assertions.byLessThan(value);
}

代码示例来源:origin: joel-costigliola/assertj-core

/**
 * Assertions entry point for Integer {@link Offset} to use with isCloseTo assertions.
 * <p>
 * Typical usage :
 * <pre><code class='java'> assertThat(10).isCloseTo(11, byLessThan(1));</code></pre>
 *
 * @param value the value of the offset.
 * @return the created {@code Offset}.
 * @throws NullPointerException if the given value is {@code null}.
 * @throws IllegalArgumentException if the given value is negative.
 * @since 3.9.0
 */
default Offset<Integer> byLessThan(Integer value) {
 return Assertions.byLessThan(value);
}

代码示例来源:origin: mozilla/zest

assertThat(request.getTimestamp()).isCloseTo(System.currentTimeMillis(), byLessThan(2000L));
assertThat(request.getMethod()).isEqualTo(method);
assertThat(request.getUrl()).isEqualTo(url);

相关文章