T - type of resourceA - type of APIC - type of ApiClientpublic abstract class AbstractApiTestBuilderResource<T,A,C> extends Object implements TestBuilderResource<T>
| Constructor and Description |
|---|
AbstractApiTestBuilderResource(AbstractTestBuilder<C> testBuilder)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
T |
addClosable(T t)
Adds closable into clean queue
|
void |
assertJsonsEqual(Object expected,
Object actual)
Asserts that actual object equals expected object when both are serialized into JSON
|
protected abstract A |
getApi()
Builds API client
|
protected Class<A> |
getApiClass()
Returns API class from generic type arguments
|
protected abstract C |
getApiClient()
Returns API client
|
protected byte[] |
getBinaryData(String authorization,
URL url)
Downloads binary data
|
protected org.skyscreamer.jsonassert.JSONCompareResult |
jsonCompare(Object expected,
Object actual)
Compares objects as serialized JSONs
|
void |
removeCloseable(Predicate<Object> predicate)
Removes a closable from clean queue
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcleanpublic AbstractApiTestBuilderResource(AbstractTestBuilder<C> testBuilder)
testBuilder - testBuilderapiClient - API clientpublic T addClosable(T t)
TestBuilderResourceaddClosable in interface TestBuilderResource<T>t - closeableprotected abstract C getApiClient()
public void removeCloseable(Predicate<Object> predicate)
predicate - filter predicateprotected abstract A getApi()
protected Class<A> getApiClass()
public void assertJsonsEqual(Object expected, Object actual) throws IOException, org.json.JSONException
expected - expectedactual - actualorg.json.JSONException - thrown when JSON serialization error occursIOException - thrown when IO Exception occursprotected org.skyscreamer.jsonassert.JSONCompareResult jsonCompare(Object expected, Object actual) throws org.json.JSONException, com.fasterxml.jackson.core.JsonProcessingException
expected - expectedactual - actualorg.json.JSONExceptioncom.fasterxml.jackson.core.JsonProcessingExceptionprotected byte[] getBinaryData(String authorization, URL url) throws IOException
authorization - authorization header valueurl - URLIOException - thrown when downloading failsCopyright © 2019 Metatavu Oy. All rights reserved.