Add Target Poll Event in Service Events (#2981)
* Add Target Poll Event in Service Events Signed-off-by: strailov <Stanislav.Trailov@bosch.io> * Target poll event to service event Signed-off-by: strailov <Stanislav.Trailov@bosch.io> --------- Signed-off-by: strailov <Stanislav.Trailov@bosch.io>
This commit is contained in:
committed by
GitHub
parent
5aafdaca6f
commit
ba3a08e560
@@ -28,6 +28,7 @@ import org.eclipse.hawkbit.repository.event.remote.service.TargetAssignDistribut
|
||||
import org.eclipse.hawkbit.repository.event.remote.service.TargetAttributesRequestedServiceEvent;
|
||||
import org.eclipse.hawkbit.repository.event.remote.service.TargetCreatedServiceEvent;
|
||||
import org.eclipse.hawkbit.repository.event.remote.service.TargetDeletedServiceEvent;
|
||||
import org.eclipse.hawkbit.repository.event.remote.service.TargetPollServiceEvent;
|
||||
import org.eclipse.hawkbit.repository.model.Action;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
import org.eclipse.hawkbit.repository.model.Target;
|
||||
@@ -78,7 +79,8 @@ class ServiceEventsTest {
|
||||
CancelTargetAssignmentEvent.class,
|
||||
TargetAttributesRequestedEvent.class,
|
||||
ActionCreatedEvent.class,
|
||||
ActionUpdatedEvent.class
|
||||
ActionUpdatedEvent.class,
|
||||
TargetPollEvent.class
|
||||
);
|
||||
assertEquals(EventPublisherHolder.SERVICE_EVENTS, expected);
|
||||
}
|
||||
@@ -130,6 +132,14 @@ class ServiceEventsTest {
|
||||
verify(streamBridge).send(eq("group"), any(CancelTargetAssignmentServiceEvent.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testTargetPollEventIsSent() {
|
||||
TargetPollEvent event = new TargetPollEvent();
|
||||
publisher.publishEvent(event);
|
||||
verify(streamBridge).send("fanout", event);
|
||||
verify(streamBridge).send(eq("group"), any(TargetPollServiceEvent.class));
|
||||
}
|
||||
|
||||
private Action mockAction() {
|
||||
final Action actionMock = mock(Action.class);
|
||||
final Target targetMock = mock(Target.class);
|
||||
|
||||
Reference in New Issue
Block a user