Api api = new Api(ApiMode.SANDBOX);
String secret = System.getProperty("BRIFLE_SECRET");
String key = System.getProperty("BRIFLE_KEY");
SuccessfulAuthenticationResponse response = api
.auth()
.authenticate(key, secret)
.getData();
String token = response.getAccessToken();
ReceiverRequest request = ReceiverRequest
.byEmail()
.withEmail("email_not_exist@brifle.de")
.withDateOfBirth("1970-01-01")
.withName("Max Mustermann")
.buildRequest();
ApiResponse<CheckReceiverResponse> re = api.content().checkReceiver(token, request);
assert re.isError();
assert re.getError().getCode() == 40401;
assert re.getError().getStatus() == 404;
assert !re.isError();
assert re.getData() != null;