Package org.assertj.guava.api
Class ByteSourceAssert
- java.lang.Object
-
- org.assertj.core.api.AbstractAssert<ByteSourceAssert,com.google.common.io.ByteSource>
-
- org.assertj.guava.api.ByteSourceAssert
-
- All Implemented Interfaces:
Assert<ByteSourceAssert,com.google.common.io.ByteSource>,Descriptable<ByteSourceAssert>,ExtensionPoints<ByteSourceAssert,com.google.common.io.ByteSource>
public class ByteSourceAssert extends AbstractAssert<ByteSourceAssert,com.google.common.io.ByteSource>
Assertions for GuavaByteSource.
-
-
Field Summary
-
Fields inherited from class org.assertj.core.api.AbstractAssert
actual, info, myself, objects, throwUnsupportedExceptionOnEquals
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedByteSourceAssert(com.google.common.io.ByteSource actual)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteSourceAsserthasSameContentAs(com.google.common.io.ByteSource other)Verifies that the actualByteSourcehas the same content as the provided one.ByteSourceAsserthasSize(long expectedSize)Verifies that the size of the actualByteSourceis equal to the given one.voidisEmpty()Verifies that the actualByteSourceis empty.-
Methods inherited from class org.assertj.core.api.AbstractAssert
actual, areEqual, asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, doesNotHaveToString, doesNotMatch, doesNotMatch, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, hasToString, inBinary, inHexadecimal, is, isElementOfCustomAssert, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, newListAssertInstance, overridingErrorMessage, overridingErrorMessage, satisfies, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOfForProxy, satisfiesForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, usingEquals, usingEquals, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnError
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.assertj.core.api.Descriptable
as, as, as, describedAs, describedAs
-
-
-
-
Method Detail
-
hasSameContentAs
public ByteSourceAssert hasSameContentAs(com.google.common.io.ByteSource other) throws java.io.IOException
Verifies that the actualByteSourcehas the same content as the provided one.
Example :
ByteSource actual = ByteSource.wrap(new byte[1]); ByteSource other = ByteSource.wrap(new byte[1]); assertThat(actual).hasSameContentAs(other);- Parameters:
other- ByteSource to compare against.- Returns:
- this
ByteSourceAssertfor assertions chaining. - Throws:
java.io.IOException- ifByteSource.contentEquals(com.google.common.io.ByteSource)throws one.java.lang.AssertionError- if the actualByteSourceisnull.java.lang.AssertionError- if the actualByteSourcedoes not contain the same content.
-
isEmpty
public void isEmpty() throws java.io.IOExceptionVerifies that the actualByteSourceis empty.Example :
ByteSource actual = ByteSource.wrap(new byte[0]); assertThat(actual).isEmpty();- Throws:
java.io.IOException- ifByteSource.isEmpty()throws one.java.lang.AssertionError- if the actualByteSourceisnull.java.lang.AssertionError- if the actualByteSourceis not empty.
-
hasSize
public ByteSourceAssert hasSize(long expectedSize) throws java.io.IOException
Verifies that the size of the actualByteSourceis equal to the given one.Example :
ByteSource actual = ByteSource.wrap(new byte[9]); assertThat(actual).hasSize(9);- Parameters:
expectedSize- the expected size of actualByteSource.- Returns:
- this
ByteSourceAssertfor assertions chaining. - Throws:
java.io.IOException- ifByteSource.size()throws one.java.lang.AssertionError- if the actualByteSourceisnull.java.lang.AssertionError- if the number of values of the actualByteSourceis not equal to the given one.
-
-