我有这段代码:
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);
}
在上面的代码中,我需要做的是能够访问entity注释中的对象。如何做呢?
LEATH
相关分类