I have this code:
public void testGetBlob() throws RequestException {
TestData.getNewApplication().flatMap(testApplication -> {
Client.initialize(testApplication.getAppId(), testApplication.getApiToken(), testApplication.getMasterKey());
assertNotNull(testApplication.getApiToken());
assertNotNull(testApplication.getAppId());
assertNotNull(testApplication.getMasterKey());
Entity entity = new Entity("Todo");
return entity.create();
}).flatMap(entity -> entity.setBlobProperty("text", "Hello world!".getBytes("UTF-8")))
.flatMap(isSuccess -> {
if(isSuccess) {
// need to access `entity` at this point
return Single.just(isSuccess);
} else {
return Single.just(false);
}
}).subscribe(success -> {
Browser.getWindow().getConsole().log("Blob created");
finishTest();
}, error -> {
Browser.getWindow().getConsole().error(error.getMessage());
fail();
});
delayTestFinish(5000);
}
In the code above what I need to do is to be able to access the entity
object at the point in the comment. How can it be done?