Merge branch 'release' of https://github.com/appsmithorg/appsmith into release
This commit is contained in:
commit
e9041d66de
7
.github/ISSUE_TEMPLATE/---bug-report.md
vendored
7
.github/ISSUE_TEMPLATE/---bug-report.md
vendored
|
|
@ -19,12 +19,7 @@ assignees: Nikhil-Nandagopal
|
||||||
|
|
||||||
Good items to include here include:
|
Good items to include here include:
|
||||||
- Console / network logs from your browser
|
- Console / network logs from your browser
|
||||||
|
- Screenshots
|
||||||
### What you expected to happen
|
|
||||||
A clear and concise description of what you expected to happen.
|
|
||||||
|
|
||||||
### Screenshots
|
|
||||||
If applicable, add screenshots to help explain your problem.
|
|
||||||
|
|
||||||
### Important Details
|
### Important Details
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -118,8 +118,10 @@ public class MongoPlugin extends BasePlugin {
|
||||||
// For the `findAndModify` command, we don't get the count of modifications made. Instead, we either
|
// For the `findAndModify` command, we don't get the count of modifications made. Instead, we either
|
||||||
// get the modified new value or the pre-modified old value (depending on the `new` field in the
|
// get the modified new value or the pre-modified old value (depending on the `new` field in the
|
||||||
// command. Let's return that value to the user.
|
// command. Let's return that value to the user.
|
||||||
if (mongoOutput.containsKey(VALUE_STR)) {
|
if (outputJson.has(VALUE_STR)) {
|
||||||
result.setBody(new JSONObject().put(VALUE_STR, mongoOutput.get(VALUE_STR)));
|
result.setBody(objectMapper.readTree(
|
||||||
|
cleanUp(new JSONObject().put(VALUE_STR, outputJson.get(VALUE_STR))).toString()
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
//The json contains key "cursor" when find command was issued and there are 1 or more results. In case
|
//The json contains key "cursor" when find command was issued and there are 1 or more results. In case
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import com.appsmith.external.models.DatasourceConfiguration;
|
||||||
import com.appsmith.external.models.Endpoint;
|
import com.appsmith.external.models.Endpoint;
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
import com.fasterxml.jackson.databind.node.ArrayNode;
|
import com.fasterxml.jackson.databind.node.ArrayNode;
|
||||||
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||||
import com.mongodb.MongoClient;
|
import com.mongodb.MongoClient;
|
||||||
import com.mongodb.client.MongoCollection;
|
import com.mongodb.client.MongoCollection;
|
||||||
import org.bson.Document;
|
import org.bson.Document;
|
||||||
|
|
@ -38,6 +39,7 @@ public class MongoPluginTest {
|
||||||
@ClassRule
|
@ClassRule
|
||||||
public static GenericContainer mongoContainer = new GenericContainer("mongo:4.2.0")
|
public static GenericContainer mongoContainer = new GenericContainer("mongo:4.2.0")
|
||||||
.withExposedPorts(27017);
|
.withExposedPorts(27017);
|
||||||
|
private JsonNode value;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
|
|
@ -172,6 +174,11 @@ public class MongoPluginTest {
|
||||||
assertNotNull(result);
|
assertNotNull(result);
|
||||||
assertTrue(result.getIsExecutionSuccess());
|
assertTrue(result.getIsExecutionSuccess());
|
||||||
assertNotNull(result.getBody());
|
assertNotNull(result.getBody());
|
||||||
|
value = ((ObjectNode) result.getBody()).get("value");
|
||||||
|
assertNotNull(value);
|
||||||
|
assertEquals("M", value.get("gender").asText());
|
||||||
|
assertEquals("Alden Cantrell", value.get("name").asText());
|
||||||
|
assertEquals(30, value.get("age").asInt());
|
||||||
})
|
})
|
||||||
.verifyComplete();
|
.verifyComplete();
|
||||||
}
|
}
|
||||||
|
|
@ -200,8 +207,8 @@ public class MongoPluginTest {
|
||||||
final JsonNode node = body.get(0);
|
final JsonNode node = body.get(0);
|
||||||
assertTrue(node.get("_id").isTextual());
|
assertTrue(node.get("_id").isTextual());
|
||||||
assertTrue(node.get("luckyNumber").isNumber());
|
assertTrue(node.get("luckyNumber").isNumber());
|
||||||
assertEquals(node.get("dob").asText(), "2018-12-31T00:00:00Z");
|
assertEquals("2018-12-31T00:00:00Z", node.get("dob").asText());
|
||||||
assertEquals(node.get("netWorth").toString(), "123456.789012");
|
assertEquals("123456.789012", node.get("netWorth").toString());
|
||||||
})
|
})
|
||||||
.verifyComplete();
|
.verifyComplete();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user