public class MockFlowFile extends Object implements FlowFileRecord
FlowFile.KeyValidator
Modifier and Type | Field and Description |
---|---|
private Map<String,String> |
attributes |
private long |
creationTime |
private byte[] |
data |
private long |
entryDate |
private long |
id |
private Set<String> |
lineageIdentifiers |
private boolean |
penalized |
Constructor and Description |
---|
MockFlowFile(long id) |
MockFlowFile(long id,
FlowFile toCopy) |
Modifier and Type | Method and Description |
---|---|
void |
assertAttributeEquals(String attributeName,
String expectedValue) |
void |
assertAttributeExists(String attributeName) |
void |
assertAttributeNotEquals(String attributeName,
String expectedValue) |
void |
assertAttributeNotExists(String attributeName) |
void |
assertContentEquals(byte[] data)
Asserts that the content of this FlowFile is the same as the content of
the given byte array
|
void |
assertContentEquals(File file)
Asserts that the content of this FlowFile is the same as the content of
the given file
|
void |
assertContentEquals(InputStream in)
Asserts that the content of this FlowFile is the same as the content of
the given InputStream.
|
void |
assertContentEquals(Path path)
Asserts that the content of this FlowFile is the same as the content of
the given path
|
void |
assertContentEquals(String data) |
void |
assertContentEquals(String data,
Charset charset) |
void |
assertContentEquals(String data,
String charset) |
int |
compareTo(FlowFile o) |
boolean |
equals(Object obj) |
String |
getAttribute(String attrName) |
Map<String,String> |
getAttributes() |
ContentClaim |
getContentClaim() |
long |
getContentClaimOffset() |
long |
getCreationTime() |
(package private) byte[] |
getData() |
long |
getEntryDate() |
long |
getId() |
Long |
getLastQueueDate() |
Set<String> |
getLineageIdentifiers() |
long |
getLineageStartDate() |
long |
getPenaltyExpirationMillis() |
long |
getSize() |
int |
hashCode() |
boolean |
isPenalized() |
void |
putAttributes(Map<String,String> attrs) |
void |
removeAttributes(Set<String> attrNames) |
(package private) void |
setData(byte[] data) |
(package private) void |
setPenalized() |
byte[] |
toByteArray() |
String |
toString() |
private final long id
private final long entryDate
private final long creationTime
private boolean penalized
private byte[] data
public MockFlowFile(long id)
public MockFlowFile(long id, FlowFile toCopy)
void setPenalized()
public long getCreationTime()
public Set<String> getLineageIdentifiers()
getLineageIdentifiers
in interface FlowFile
public long getLineageStartDate()
getLineageStartDate
in interface FlowFile
public int compareTo(FlowFile o)
compareTo
in interface Comparable<FlowFile>
public String getAttribute(String attrName)
getAttribute
in interface FlowFile
public Map<String,String> getAttributes()
getAttributes
in interface FlowFile
public long getEntryDate()
getEntryDate
in interface FlowFile
void setData(byte[] data)
byte[] getData()
public boolean isPenalized()
isPenalized
in interface FlowFile
public void assertAttributeExists(String attributeName)
public void assertAttributeNotExists(String attributeName)
public void assertAttributeNotEquals(String attributeName, String expectedValue)
public void assertContentEquals(File file) throws IOException
file
- to compare content againstIOException
- if fails doing IO during comparisonpublic void assertContentEquals(Path path) throws IOException
path
- where to find content to compare toIOException
- if io error occurs while comparing contentpublic void assertContentEquals(byte[] data) throws IOException
data
- the data to compareIOException
- if any ioe occurs while reading flowfilepublic void assertContentEquals(String data)
public void assertContentEquals(InputStream in) throws IOException
in
- the stream to source comparison data fromIOException
- if any issues reading from given sourcepublic byte[] toByteArray()
public Long getLastQueueDate()
getLastQueueDate
in interface FlowFile
public long getPenaltyExpirationMillis()
getPenaltyExpirationMillis
in interface FlowFileRecord
public ContentClaim getContentClaim()
getContentClaim
in interface FlowFileRecord
public long getContentClaimOffset()
getContentClaimOffset
in interface FlowFileRecord
Copyright © 2017 Apache NiFi Project. All rights reserved.