@Test public void testSetRegexActions() throws InvalidParseOperationException { AbstractParser<?> parserMulti = new UpdateParserMultiple(new SingleVarNameAdapter()); parserMulti.parse(JsonHandler.getFromString(requestSetRegexRemovePrefix)); JsonNode result = mDIM.getUpdateJson(parserMulti); assertEquals("Old", result.get("oldField").asText()); parserMulti.parse(JsonHandler.getFromString(requestSetRegexReplaceAll)); result = mDIM.getUpdateJson(parserMulti); assertEquals("newValue", result.get("oldValue").asText()); parserMulti.parse(JsonHandler.getFromString(requestSetRegexStringArray)); result = mDIM.getUpdateJson(parserMulti); assertEquals("[\"W1\",\"\",\"W2\"]", JsonHandler.unprettyPrint(result.get("arrayRegex"))); parserMulti.parse(JsonHandler.getFromString(requestSetRegexExpand)); result = mDIM.getUpdateJson(parserMulti); assertEquals("XXXXXX", result.get("expandField").asText()); parserMulti.parse(JsonHandler.getFromString(requestSetRegexNonExitingField)); mDIM.getUpdateJson(parserMulti); parserMulti.parse(JsonHandler.getFromString(requestSetRegexSubField)); mDIM.getUpdateJson(parserMulti); assertEquals("[\"newSubValue\"]", JsonHandler.unprettyPrint(result.get("subItem").get("subArray"))); parserMulti.parse(JsonHandler.getFromString(requestSetRegexNullField)); mDIM.getUpdateJson(parserMulti); }
public JsonNode getUpdateJson(JsonNode request, boolean isMultiple, VarNameAdapter varNameAdapter) throws InvalidParseOperationException { final AbstractParser<?> parser; if (isMultiple) { parser = new UpdateParserMultiple(varNameAdapter); } else { parser = new UpdateParserSingle(varNameAdapter); } parser.parse(request); return getUpdateJson(parser); }
MongoDbInMemory { public JsonNode getUpdateJson(JsonNode request, boolean isMultiple, VarNameAdapter varNameAdapter) throws InvalidParseOperationException { final AbstractParser<?> parser; if (isMultiple) { parser = new UpdateParserMultiple(varNameAdapter); } else { parser = new UpdateParserSingle(varNameAdapter); } parser.parse(request); return getUpdateJson(parser); } }
MongoDbInMemory { public JsonNode getUpdateJson(JsonNode request, boolean isMultiple, VarNameAdapter varNameAdapter) throws InvalidParseOperationException { final AbstractParser<?> parser; if (isMultiple) { parser = new UpdateParserMultiple(varNameAdapter); } else { parser = new UpdateParserSingle(varNameAdapter); } parser.parse(request); return getUpdateJson(parser); } MongoDbInMemory(JsonNode originalDocument, DynamicParserTokens parserTokens); }
MongoDbInMemory { public JsonNode getUpdateJson(JsonNode request, boolean isMultiple, VarNameAdapter varNameAdapter) throws InvalidParseOperationException { final AbstractParser<?> parser; if (isMultiple) { parser = new UpdateParserMultiple(varNameAdapter); } else { parser = new UpdateParserSingle(varNameAdapter); } parser.parse(request); return getUpdateJson(parser); } MongoDbInMemory(JsonNode originalDocument, DynamicParserTokens parserTokens); JsonNode getUpdateJson(JsonNode request, boolean isMultiple, VarNameAdapter varNameAdapter); JsonNode getUpdateJson(AbstractParser<?> requestParser); JsonNode getUpdateJsonForRule(RuleActions ruleActions, Map<String, DurationData> bindRuleToDuration); @VisibleForTesting void resetUpdatedAU(); Set<String> getUpdatedFields(); }
MongoDbInMemory { public JsonNode getUpdateJson(JsonNode request, boolean isMultiple, VarNameAdapter varNameAdapter) throws InvalidParseOperationException { final AbstractParser<?> parser; if (isMultiple) { parser = new UpdateParserMultiple(varNameAdapter); } else { parser = new UpdateParserSingle(varNameAdapter); } parser.parse(request); return getUpdateJson(parser); } MongoDbInMemory(JsonNode originalDocument, DynamicParserTokens parserTokens); JsonNode getUpdateJson(JsonNode request, boolean isMultiple, VarNameAdapter varNameAdapter); JsonNode getUpdateJson(AbstractParser<?> requestParser); JsonNode getUpdateJsonForRule(RuleActions ruleActions, Map<String, DurationData> bindRuleToDuration); @VisibleForTesting void resetUpdatedAU(); Set<String> getUpdatedFields();  }