use of com.adobe.target.delivery.v1.model.MboxRequest in project target-java-sdk by adobe.
the class OnDeviceDecisioningEvaluatorTest method testAllLocalNoRemoteMbox.
@Test
public void testAllLocalNoRemoteMbox() throws JsonProcessingException, NoSuchFieldException {
OnDeviceDecisioningRuleSet ruleSet = new OnDeviceDecisioningRuleSet();
List<String> localMboxes = new ArrayList<>();
localMboxes.add("test");
localMboxes.add("test2");
FieldSetter.setField(ruleSet, ruleSet.getClass().getDeclaredField("localMboxes"), localMboxes);
FieldSetter.setField(ruleSet, ruleSet.getClass().getDeclaredField("remoteMboxes"), new ArrayList<String>());
String serializedRuleSet = objectMapper.writeValueAsString(ruleSet);
RuleLoader testRuleLoader = TargetTestDeliveryRequestUtils.getTestRuleLoader(serializedRuleSet);
evaluator = new OnDeviceDecisioningEvaluator(testRuleLoader);
TargetDeliveryRequest request = TargetDeliveryRequest.builder().execute(new ExecuteRequest().addMboxesItem(new MboxRequest().name("test")).addMboxesItem(new MboxRequest().name("test2"))).build();
OnDeviceDecisioningEvaluation evaluation = evaluator.evaluateLocalExecution(request);
assertTrue(evaluation.isAllLocal());
assertNull(evaluation.getRemoteMBoxes());
assertNull(evaluation.getRemoteViews());
}
Aggregations