use of com.adobe.target.edge.client.ondevice.collator.ParamsCollator in project target-java-sdk by adobe.
the class TargetDeliveryRequestLocalViewTest method init.
@BeforeEach
@SuppressWarnings("unchecked")
void init() throws NoSuchFieldException {
Mockito.lenient().doReturn(getTestDeliveryResponse()).when(defaultTargetHttpClient).execute(any(Map.class), any(String.class), any(DeliveryRequest.class), any(Class.class));
ClientConfig clientConfig = ClientConfig.builder().client("emeaprod4").organizationId(TEST_ORG_ID).build();
TelemetryService telemetryService = new TelemetryService(clientConfig);
DefaultTargetService targetService = new DefaultTargetService(clientConfig, telemetryService);
localService = new OnDeviceDecisioningService(clientConfig, targetService, telemetryService);
ObjectMapper mapper = new JacksonObjectMapper().getMapper();
OnDeviceDecisioningDetailsExecutor decisionHandler = new OnDeviceDecisioningDetailsExecutor(clientConfig, mapper);
targetJavaClient = TargetClient.create(clientConfig);
FieldSetter.setField(targetService, targetService.getClass().getDeclaredField("targetHttpClient"), defaultTargetHttpClient);
FieldSetter.setField(targetJavaClient, targetJavaClient.getClass().getDeclaredField("targetService"), targetService);
FieldSetter.setField(targetJavaClient, targetJavaClient.getClass().getDeclaredField("localService"), localService);
FieldSetter.setField(localService, localService.getClass().getDeclaredField("decisionHandler"), decisionHandler);
ParamsCollator specificTimeCollator = TargetTestDeliveryRequestUtils.getSpecificTimeCollator(1582818503000L);
FieldSetter.setField(localService, localService.getClass().getDeclaredField("timeParamsCollator"), specificTimeCollator);
FieldSetter.setField(localService, localService.getClass().getDeclaredField("notificationService"), mock(NotificationService.class));
FieldSetter.setField(localService, localService.getClass().getDeclaredField("clusterLocator"), mock(ClusterLocator.class));
}
use of com.adobe.target.edge.client.ondevice.collator.ParamsCollator in project target-java-sdk by adobe.
the class TargetDeliveryRequestLocalMboxTest method init.
@BeforeEach
@SuppressWarnings("unchecked")
void init() throws NoSuchFieldException {
Mockito.lenient().doReturn(getTestDeliveryResponse()).when(defaultTargetHttpClient).execute(any(Map.class), any(String.class), any(DeliveryRequest.class), any(Class.class));
ClientConfig clientConfig = ClientConfig.builder().client("emeaprod4").organizationId(TEST_ORG_ID).build();
TelemetryService telemetryService = new TelemetryService(clientConfig);
DefaultTargetService targetService = new DefaultTargetService(clientConfig, telemetryService);
localService = new OnDeviceDecisioningService(clientConfig, targetService, telemetryService);
ObjectMapper mapper = new JacksonObjectMapper().getMapper();
OnDeviceDecisioningDetailsExecutor decisionHandler = new OnDeviceDecisioningDetailsExecutor(clientConfig, mapper);
targetJavaClient = TargetClient.create(clientConfig);
FieldSetter.setField(targetService, targetService.getClass().getDeclaredField("targetHttpClient"), defaultTargetHttpClient);
FieldSetter.setField(targetJavaClient, targetJavaClient.getClass().getDeclaredField("targetService"), targetService);
FieldSetter.setField(targetJavaClient, targetJavaClient.getClass().getDeclaredField("localService"), localService);
FieldSetter.setField(localService, localService.getClass().getDeclaredField("decisionHandler"), decisionHandler);
ParamsCollator specificTimeCollator = TargetTestDeliveryRequestUtils.getSpecificTimeCollator(1582818503000L);
FieldSetter.setField(localService, localService.getClass().getDeclaredField("timeParamsCollator"), specificTimeCollator);
FieldSetter.setField(localService, localService.getClass().getDeclaredField("notificationService"), mock(NotificationService.class));
FieldSetter.setField(localService, localService.getClass().getDeclaredField("clusterLocator"), mock(ClusterLocator.class));
}
Aggregations