Restructure Tenant Configuration View to make it more flexible for adaptations (#1043)
* Extract view creation for Configuration Components into Beans; Split implementations of config Binders into corresponding view classes: - add ProxySystemConfig classes respectively for ConfigurationViews; - create Binder and config Bean in BaseConfigurationView via Generics; - extend ConfigurationViews from BaseConfigurationView; - populate Binders and config Bean in ConfigurationView; - access binder getter/setter in ConfigurationItem through corresponding ProxySystemConfig; - autowire Collection of Config Views in TenantConfigurationDashboardView; - create components, call save and undo for each config view in Collection Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io> * Do not send the target token when anonymous download is enabled Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io> * Update amqp tests to cover enabled anonymous download config Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io> * Do not change TargetToken functionality for hawkbit; Make createDownloadAndUpdateRequest protected; Undo some of previous test changes; Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io> * Add license header to ProxySystemConfigDsType Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io> * Call save methods for filtered ConfigurationViews only, not the autowired. Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io> * Document public classes Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io> * Adopt Review Comments: - Rename DefaultDistributionSetTypeLayout - Remove unnecessary qualifier TenantConfigurationProperties Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io> * Refactoring: implement InitializingBean instead of using PostConstruct Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io> * Apply to remaining classes: implement InitializingBean instead of using PostConstruct Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io> * Removed unnecessary method notifyConfigurationChanged(); Documented Bean creation of configuration views Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io> * Rename TenantConfigurationAutoConfiguration to SystemConfigViewAutoConfiguration Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io> * Rename init method of DefaultDistributionSetTypeView Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>
This commit is contained in:
@@ -105,8 +105,8 @@ public class AmqpConfiguration {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link RabbitTemplate} with automatic retry, published confirms
|
||||
* and {@link Jackson2JsonMessageConverter}.
|
||||
* @return {@link RabbitTemplate} with automatic retry, published confirms and
|
||||
* {@link Jackson2JsonMessageConverter}.
|
||||
*/
|
||||
@Bean
|
||||
public RabbitTemplate rabbitTemplate() {
|
||||
@@ -140,8 +140,8 @@ public class AmqpConfiguration {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the DMF API receiver queue for authentication requests called by
|
||||
* 3rd party artifact storages for download authorization by devices.
|
||||
* Create the DMF API receiver queue for authentication requests called by 3rd
|
||||
* party artifact storages for download authorization by devices.
|
||||
*
|
||||
* @return the receiver queue
|
||||
*/
|
||||
@@ -183,8 +183,7 @@ public class AmqpConfiguration {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the Binding
|
||||
* {@link AmqpConfiguration#authenticationReceiverQueue()} to
|
||||
* Create the Binding {@link AmqpConfiguration#authenticationReceiverQueue()} to
|
||||
* {@link AmqpConfiguration#authenticationExchange()}.
|
||||
*
|
||||
* @return the binding and create the queue and exchange
|
||||
|
||||
@@ -139,18 +139,13 @@ public class AmqpMessageDispatcherService extends BaseAmqpService {
|
||||
if (!shouldBeProcessed(assignedEvent)) {
|
||||
return;
|
||||
}
|
||||
|
||||
LOG.debug("targetAssignDistributionSet retrieved. I will forward it to DMF broker.");
|
||||
|
||||
distributionSetManagement.get(assignedEvent.getDistributionSetId()).ifPresent(ds -> {
|
||||
|
||||
final Map<SoftwareModule, List<SoftwareModuleMetadata>> softwareModules = getSoftwareModulesWithMetadata(
|
||||
ds);
|
||||
|
||||
targetManagement.getByControllerID(assignedEvent.getActions().keySet()).forEach(
|
||||
target -> sendUpdateMessageToTarget(assignedEvent.getActions().get(target.getControllerId()),
|
||||
target, softwareModules));
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -186,7 +181,6 @@ public class AmqpMessageDispatcherService extends BaseAmqpService {
|
||||
action -> action.getDistributionSet().getModules().stream()
|
||||
.collect(Collectors.toMap(m -> m, softwareModuleMetadata::get)));
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
@@ -194,8 +188,8 @@ public class AmqpMessageDispatcherService extends BaseAmqpService {
|
||||
protected void sendMultiActionRequestToTarget(final String tenant, final Target target, final List<Action> actions,
|
||||
final Function<Action, Map<SoftwareModule, List<SoftwareModuleMetadata>>> getSoftwareModuleMetaData) {
|
||||
|
||||
final URI targetAdress = target.getAddress();
|
||||
if (!IpUtil.isAmqpUri(targetAdress) || CollectionUtils.isEmpty(actions)) {
|
||||
final URI targetAddress = target.getAddress();
|
||||
if (!IpUtil.isAmqpUri(targetAddress) || CollectionUtils.isEmpty(actions)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -209,8 +203,7 @@ public class AmqpMessageDispatcherService extends BaseAmqpService {
|
||||
|
||||
final Message message = getMessageConverter().toMessage(multiActionRequest,
|
||||
createConnectorMessagePropertiesEvent(tenant, target.getControllerId(), EventTopic.MULTI_ACTION));
|
||||
amqpSenderService.sendMessage(message, targetAdress);
|
||||
|
||||
amqpSenderService.sendMessage(message, targetAddress);
|
||||
}
|
||||
|
||||
private DmfActionRequest createDmfActionRequest(final Target target, final Action action,
|
||||
@@ -218,8 +211,7 @@ public class AmqpMessageDispatcherService extends BaseAmqpService {
|
||||
if (action.isCancelingOrCanceled()) {
|
||||
return createPlainActionRequest(action);
|
||||
}
|
||||
return createDownloadAndUpdateRequest(target, action, softwareModules);
|
||||
|
||||
return createDownloadAndUpdateRequest(target, action.getId(), softwareModules);
|
||||
}
|
||||
|
||||
private static DmfActionRequest createPlainActionRequest(final Action action) {
|
||||
@@ -228,11 +220,12 @@ public class AmqpMessageDispatcherService extends BaseAmqpService {
|
||||
return actionRequest;
|
||||
}
|
||||
|
||||
private DmfDownloadAndUpdateRequest createDownloadAndUpdateRequest(final Target target, final Action action,
|
||||
protected DmfDownloadAndUpdateRequest createDownloadAndUpdateRequest(final Target target, final Long actionId,
|
||||
final Map<SoftwareModule, List<SoftwareModuleMetadata>> softwareModules) {
|
||||
final DmfDownloadAndUpdateRequest request = new DmfDownloadAndUpdateRequest();
|
||||
request.setActionId(action.getId());
|
||||
request.setActionId(actionId);
|
||||
request.setTargetSecurityToken(systemSecurityContext.runAsSystem(target::getSecurityToken));
|
||||
|
||||
if (softwareModules != null) {
|
||||
softwareModules.entrySet()
|
||||
.forEach(entry -> request.addSoftwareModule(convertToAmqpSoftwareModule(target, entry)));
|
||||
@@ -325,26 +318,15 @@ public class AmqpMessageDispatcherService extends BaseAmqpService {
|
||||
|
||||
final String tenant = action.getTenant();
|
||||
|
||||
final URI targetAdress = target.getAddress();
|
||||
if (!IpUtil.isAmqpUri(targetAdress)) {
|
||||
final URI targetAddress = target.getAddress();
|
||||
if (!IpUtil.isAmqpUri(targetAddress)) {
|
||||
return;
|
||||
}
|
||||
|
||||
final DmfDownloadAndUpdateRequest downloadAndUpdateRequest = new DmfDownloadAndUpdateRequest();
|
||||
downloadAndUpdateRequest.setActionId(action.getId());
|
||||
|
||||
final String targetSecurityToken = systemSecurityContext.runAsSystem(target::getSecurityToken);
|
||||
downloadAndUpdateRequest.setTargetSecurityToken(targetSecurityToken);
|
||||
|
||||
modules.entrySet().forEach(entry -> {
|
||||
|
||||
final DmfSoftwareModule amqpSoftwareModule = convertToAmqpSoftwareModule(target, entry);
|
||||
downloadAndUpdateRequest.addSoftwareModule(amqpSoftwareModule);
|
||||
});
|
||||
|
||||
final DmfDownloadAndUpdateRequest downloadAndUpdateRequest = createDownloadAndUpdateRequest(target, action.getId(), modules);
|
||||
final Message message = getMessageConverter().toMessage(downloadAndUpdateRequest,
|
||||
createConnectorMessagePropertiesEvent(tenant, target.getControllerId(), getEventTypeForTarget(action)));
|
||||
amqpSenderService.sendMessage(message, targetAdress);
|
||||
amqpSenderService.sendMessage(message, targetAddress);
|
||||
}
|
||||
|
||||
protected void sendPingReponseToDmfReceiver(final Message ping, final String tenant, final String virtualHost) {
|
||||
@@ -359,7 +341,6 @@ public class AmqpMessageDispatcherService extends BaseAmqpService {
|
||||
}
|
||||
|
||||
private void sendDeleteMessage(final String tenant, final String controllerId, final String targetAddress) {
|
||||
|
||||
if (!hasValidAddress(targetAddress)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ import static org.mockito.Mockito.when;
|
||||
import java.io.File;
|
||||
import java.net.URI;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
@@ -35,6 +35,7 @@ import org.eclipse.hawkbit.dmf.amqp.api.MessageType;
|
||||
import org.eclipse.hawkbit.dmf.json.model.DmfActionRequest;
|
||||
import org.eclipse.hawkbit.dmf.json.model.DmfDownloadAndUpdateRequest;
|
||||
import org.eclipse.hawkbit.dmf.json.model.DmfMetadata;
|
||||
import org.eclipse.hawkbit.dmf.json.model.DmfSoftwareModule;
|
||||
import org.eclipse.hawkbit.repository.SystemManagement;
|
||||
import org.eclipse.hawkbit.repository.event.remote.TargetAssignDistributionSetEvent;
|
||||
import org.eclipse.hawkbit.repository.event.remote.TargetAttributesRequestedEvent;
|
||||
@@ -101,7 +102,7 @@ public class AmqpMessageDispatcherServiceTest extends AbstractIntegrationTest {
|
||||
|
||||
final ArtifactUrlHandler artifactUrlHandlerMock = Mockito.mock(ArtifactUrlHandler.class);
|
||||
when(artifactUrlHandlerMock.getUrls(any(), any()))
|
||||
.thenReturn(Arrays.asList(new ArtifactUrl("http", "download", "http://mockurl")));
|
||||
.thenReturn(Collections.singletonList(new ArtifactUrl("http", "download", "http://mockurl")));
|
||||
|
||||
systemManagement = Mockito.mock(SystemManagement.class);
|
||||
final TenantMetaData tenantMetaData = Mockito.mock(TenantMetaData.class);
|
||||
@@ -116,11 +117,10 @@ public class AmqpMessageDispatcherServiceTest extends AbstractIntegrationTest {
|
||||
|
||||
}
|
||||
|
||||
private Message getCaptureAdressEvent(final TargetAssignDistributionSetEvent targetAssignDistributionSetEvent) {
|
||||
private Message getCaptureAddressEvent(final TargetAssignDistributionSetEvent targetAssignDistributionSetEvent) {
|
||||
final Target target = targetManagement
|
||||
.getByControllerID(targetAssignDistributionSetEvent.getActions().keySet().iterator().next()).get();
|
||||
final Message sendMessage = createArgumentCapture(target.getAddress());
|
||||
return sendMessage;
|
||||
return createArgumentCapture(target.getAddress());
|
||||
}
|
||||
|
||||
private Action createAction(final DistributionSet testDs) {
|
||||
@@ -128,8 +128,8 @@ public class AmqpMessageDispatcherServiceTest extends AbstractIntegrationTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Description("Verifies that download and install event with 3 software moduls and no artifacts works")
|
||||
public void testSendDownloadRequesWithSoftwareModulesAndNoArtifacts() {
|
||||
@Description("Verifies that download and install event with 3 software modules and no artifacts works")
|
||||
public void testSendDownloadRequestWithSoftwareModulesAndNoArtifacts() {
|
||||
final DistributionSet createDistributionSet = testdataFactory
|
||||
.createDistributionSet(UUID.randomUUID().toString());
|
||||
testdataFactory.addSoftwareModuleMetadata(createDistributionSet);
|
||||
@@ -139,7 +139,7 @@ public class AmqpMessageDispatcherServiceTest extends AbstractIntegrationTest {
|
||||
final TargetAssignDistributionSetEvent targetAssignDistributionSetEvent = new TargetAssignDistributionSetEvent(
|
||||
action, serviceMatcher.getServiceId());
|
||||
amqpMessageDispatcherService.targetAssignDistributionSet(targetAssignDistributionSetEvent);
|
||||
final Message sendMessage = getCaptureAdressEvent(targetAssignDistributionSetEvent);
|
||||
final Message sendMessage = getCaptureAddressEvent(targetAssignDistributionSetEvent);
|
||||
final DmfDownloadAndUpdateRequest downloadAndUpdateRequest = assertDownloadAndInstallMessage(sendMessage,
|
||||
action.getId());
|
||||
assertThat(createDistributionSet.getModules()).hasSameSizeAs(downloadAndUpdateRequest.getSoftwareModules());
|
||||
@@ -152,7 +152,7 @@ public class AmqpMessageDispatcherServiceTest extends AbstractIntegrationTest {
|
||||
new DmfMetadata(TestdataFactory.VISIBLE_SM_MD_KEY, TestdataFactory.VISIBLE_SM_MD_VALUE));
|
||||
|
||||
for (final SoftwareModule softwareModule2 : action.getDistributionSet().getModules()) {
|
||||
assertNotNull("Sofware module ID should be set", softwareModule.getModuleId());
|
||||
assertNotNull("Software module ID should be set", softwareModule.getModuleId());
|
||||
if (!softwareModule.getModuleId().equals(softwareModule2.getId())) {
|
||||
continue;
|
||||
}
|
||||
@@ -186,7 +186,7 @@ public class AmqpMessageDispatcherServiceTest extends AbstractIntegrationTest {
|
||||
final TargetAssignDistributionSetEvent targetAssignDistributionSetEvent = new TargetAssignDistributionSetEvent(
|
||||
action, serviceMatcher.getServiceId());
|
||||
amqpMessageDispatcherService.targetAssignDistributionSet(targetAssignDistributionSetEvent);
|
||||
final Message sendMessage = getCaptureAdressEvent(targetAssignDistributionSetEvent);
|
||||
final Message sendMessage = getCaptureAddressEvent(targetAssignDistributionSetEvent);
|
||||
final DmfDownloadAndUpdateRequest downloadAndUpdateRequest = assertDownloadAndInstallMessage(sendMessage,
|
||||
action.getId());
|
||||
|
||||
@@ -194,8 +194,7 @@ public class AmqpMessageDispatcherServiceTest extends AbstractIntegrationTest {
|
||||
downloadAndUpdateRequest.getSoftwareModules().size());
|
||||
assertThat(downloadAndUpdateRequest.getTargetSecurityToken()).isEqualTo(TEST_TOKEN);
|
||||
|
||||
for (final org.eclipse.hawkbit.dmf.json.model.DmfSoftwareModule softwareModule : downloadAndUpdateRequest
|
||||
.getSoftwareModules()) {
|
||||
for (final DmfSoftwareModule softwareModule : downloadAndUpdateRequest.getSoftwareModules()) {
|
||||
if (!softwareModule.getModuleId().equals(module.getId())) {
|
||||
continue;
|
||||
}
|
||||
@@ -259,7 +258,7 @@ public class AmqpMessageDispatcherServiceTest extends AbstractIntegrationTest {
|
||||
|
||||
@Test
|
||||
@Description("Verifies that a delete message is not send if the address is not an amqp address.")
|
||||
public void sendDeleteRequestWithNoAmqpAdress() {
|
||||
public void sendDeleteRequestWithNoAmqpAddress() {
|
||||
|
||||
// setup
|
||||
final String noAmqpUri = "http://anyhost";
|
||||
@@ -274,8 +273,8 @@ public class AmqpMessageDispatcherServiceTest extends AbstractIntegrationTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Description("Verfies that a delete message is not send if the address is null.")
|
||||
public void sendDeleteRequestWithNullAdress() {
|
||||
@Description("Verifies that a delete message is not send if the address is null.")
|
||||
public void sendDeleteRequestWithNullAddress() {
|
||||
|
||||
// setup
|
||||
final String noAmqpUri = null;
|
||||
@@ -293,7 +292,7 @@ public class AmqpMessageDispatcherServiceTest extends AbstractIntegrationTest {
|
||||
assertEventMessage(sendMessage);
|
||||
final DmfActionRequest actionId = convertMessage(sendMessage, DmfActionRequest.class);
|
||||
assertEquals("Action ID should be 1", actionId.getActionId(), Long.valueOf(1));
|
||||
assertEquals("The topc in the message should be a CANCEL_DOWNLOAD value", EventTopic.CANCEL_DOWNLOAD,
|
||||
assertEquals("The topic in the message should be a CANCEL_DOWNLOAD value", EventTopic.CANCEL_DOWNLOAD,
|
||||
sendMessage.getMessageProperties().getHeaders().get(MessageHeaderKey.TOPIC));
|
||||
}
|
||||
|
||||
|
||||
@@ -93,9 +93,7 @@ public abstract class AbstractAmqpServiceIntegrationTest extends AbstractAmqpInt
|
||||
}
|
||||
|
||||
private <T> T waitUntilIsPresent(final Callable<Optional<T>> callable) {
|
||||
createConditionFactory().until(() -> {
|
||||
return securityRule.runAsPrivileged(() -> callable.call().isPresent());
|
||||
});
|
||||
createConditionFactory().until(() -> securityRule.runAsPrivileged(() -> callable.call().isPresent()));
|
||||
|
||||
try {
|
||||
return securityRule.runAsPrivileged(() -> callable.call().get());
|
||||
@@ -105,10 +103,8 @@ public abstract class AbstractAmqpServiceIntegrationTest extends AbstractAmqpInt
|
||||
}
|
||||
|
||||
protected void waitUntilEventMessagesAreDispatchedToTarget(final EventTopic... eventTopics) {
|
||||
createConditionFactory().untilAsserted(() -> {
|
||||
assertThat(replyToListener.getLatestEventMessageTopics())
|
||||
.containsExactlyInAnyOrderElementsOf(Arrays.asList(eventTopics));
|
||||
});
|
||||
createConditionFactory().untilAsserted(() -> assertThat(replyToListener.getLatestEventMessageTopics())
|
||||
.containsExactlyInAnyOrderElementsOf(Arrays.asList(eventTopics)));
|
||||
replyToListener.resetLatestEventMessageTopics();
|
||||
}
|
||||
|
||||
@@ -194,10 +190,10 @@ public abstract class AbstractAmqpServiceIntegrationTest extends AbstractAmqpInt
|
||||
protected void assertDmfDownloadAndUpdateRequest(final DmfDownloadAndUpdateRequest request,
|
||||
final Set<SoftwareModule> softwareModules, final String controllerId) {
|
||||
Assert.assertThat(softwareModules, SoftwareModuleJsonMatcher.containsExactly(request.getSoftwareModules()));
|
||||
request.getSoftwareModules()
|
||||
.forEach(dmfModule -> assertThat(dmfModule.getMetadata()).containsExactly(
|
||||
new DmfMetadata(TestdataFactory.VISIBLE_SM_MD_KEY, TestdataFactory.VISIBLE_SM_MD_VALUE)));
|
||||
request.getSoftwareModules().forEach(dmfModule -> assertThat(dmfModule.getMetadata()).containsExactly(
|
||||
new DmfMetadata(TestdataFactory.VISIBLE_SM_MD_KEY, TestdataFactory.VISIBLE_SM_MD_VALUE)));
|
||||
final Target updatedTarget = waitUntilIsPresent(() -> targetManagement.getByControllerID(controllerId));
|
||||
assertThat(updatedTarget).isNotNull();
|
||||
assertThat(updatedTarget.getSecurityToken()).isEqualTo(request.getTargetSecurityToken());
|
||||
}
|
||||
|
||||
@@ -223,9 +219,8 @@ public abstract class AbstractAmqpServiceIntegrationTest extends AbstractAmqpInt
|
||||
}
|
||||
|
||||
protected void verifyReplyToListener() {
|
||||
createConditionFactory().untilAsserted(() -> {
|
||||
Mockito.verify(replyToListener, Mockito.atLeast(1)).handleMessage(Mockito.any());
|
||||
});
|
||||
createConditionFactory()
|
||||
.untilAsserted(() -> Mockito.verify(replyToListener, Mockito.atLeast(1)).handleMessage(Mockito.any()));
|
||||
}
|
||||
|
||||
protected Long cancelAction(final Long actionId, final String controllerId) {
|
||||
@@ -273,9 +268,10 @@ public abstract class AbstractAmqpServiceIntegrationTest extends AbstractAmqpInt
|
||||
final int existingTargetsAfterCreation, final TargetUpdateStatus expectedTargetStatus,
|
||||
final String createdBy) {
|
||||
createAndSendThingCreated(target, TENANT_EXIST);
|
||||
final Target registerdTarget = waitUntilIsPresent(() -> targetManagement.getByControllerID(target));
|
||||
final Target registeredTarget = waitUntilIsPresent(() -> targetManagement.getByControllerID(target));
|
||||
assertAllTargetsCount(existingTargetsAfterCreation);
|
||||
assertTarget(registerdTarget, expectedTargetStatus, createdBy);
|
||||
assertThat(registeredTarget).isNotNull();
|
||||
assertTarget(registeredTarget, expectedTargetStatus, createdBy);
|
||||
}
|
||||
|
||||
protected void registerSameTargetAndAssertBasedOnVersion(final String controllerId,
|
||||
@@ -284,6 +280,7 @@ public abstract class AbstractAmqpServiceIntegrationTest extends AbstractAmqpInt
|
||||
createAndSendThingCreated(controllerId, TENANT_EXIST);
|
||||
final Target registeredTarget = waitUntilIsPresent(() -> findTargetBasedOnNewVersion(controllerId, version));
|
||||
assertAllTargetsCount(existingTargetsAfterCreation);
|
||||
assertThat(registeredTarget).isNotNull();
|
||||
assertThat(registeredTarget.getUpdateStatus()).isEqualTo(expectedTargetStatus);
|
||||
}
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ public class AmqpMessageDispatcherServiceIntegrationTest extends AbstractAmqpSer
|
||||
final Long actionId1 = assignNewDsToTarget(controllerId, 450);
|
||||
final Entry<Long, EventTopic> action1Install = new SimpleEntry<>(actionId1, EventTopic.DOWNLOAD_AND_INSTALL);
|
||||
waitUntilEventMessagesAreDispatchedToTarget(EventTopic.MULTI_ACTION);
|
||||
assertLatestMultiActionMessage(controllerId, Arrays.asList(action1Install));
|
||||
assertLatestMultiActionMessage(controllerId, Collections.singletonList(action1Install));
|
||||
|
||||
final Long actionId2 = assignNewDsToTarget(controllerId, 111);
|
||||
final Entry<Long, EventTopic> action2Install = new SimpleEntry<>(actionId2, EventTopic.DOWNLOAD_AND_INSTALL);
|
||||
@@ -273,7 +273,7 @@ public class AmqpMessageDispatcherServiceIntegrationTest extends AbstractAmqpSer
|
||||
updateActionViaDmfClient(controllerId, actionId1, DmfActionStatus.CANCELED);
|
||||
|
||||
waitUntilEventMessagesAreDispatchedToTarget(EventTopic.MULTI_ACTION);
|
||||
assertLatestMultiActionMessage(controllerId, Arrays.asList(action2Install));
|
||||
assertLatestMultiActionMessage(controllerId, Collections.singletonList(action2Install));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -300,7 +300,7 @@ public class AmqpMessageDispatcherServiceIntegrationTest extends AbstractAmqpSer
|
||||
updateActionViaDmfClient(controllerId, actionId1, DmfActionStatus.FINISHED);
|
||||
waitUntilEventMessagesAreDispatchedToTarget(EventTopic.REQUEST_ATTRIBUTES_UPDATE, EventTopic.MULTI_ACTION);
|
||||
assertRequestAttributesUpdateMessage(controllerId);
|
||||
assertLatestMultiActionMessage(controllerId, Arrays.asList(action2Install));
|
||||
assertLatestMultiActionMessage(controllerId, Collections.singletonList(action2Install));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -371,7 +371,7 @@ public class AmqpMessageDispatcherServiceIntegrationTest extends AbstractAmqpSer
|
||||
|
||||
createAndStartRollout(ds, filterQuery, 122);
|
||||
waitUntilEventMessagesAreDispatchedToTarget(EventTopic.MULTI_ACTION);
|
||||
assertLatestMultiActionMessageContainsInstallMessages(controllerId, Arrays.asList(smIds));
|
||||
assertLatestMultiActionMessageContainsInstallMessages(controllerId, Collections.singletonList(smIds));
|
||||
|
||||
createAndStartRollout(ds, filterQuery, 43);
|
||||
waitUntilEventMessagesAreDispatchedToTarget(EventTopic.MULTI_ACTION);
|
||||
@@ -418,7 +418,7 @@ public class AmqpMessageDispatcherServiceIntegrationTest extends AbstractAmqpSer
|
||||
|
||||
updateActionViaDmfClient(controllerId, installActions.get(1), DmfActionStatus.FINISHED);
|
||||
waitUntilEventMessagesAreDispatchedToTarget(EventTopic.REQUEST_ATTRIBUTES_UPDATE, EventTopic.MULTI_ACTION);
|
||||
assertLatestMultiActionMessageContainsInstallMessages(controllerId, Arrays.asList(smIds1));
|
||||
assertLatestMultiActionMessageContainsInstallMessages(controllerId, Collections.singletonList(smIds1));
|
||||
}
|
||||
|
||||
private Set<Long> getSoftwareModuleIds(final DistributionSet ds) {
|
||||
|
||||
@@ -82,12 +82,12 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Autowired
|
||||
private AmqpProperties amqpProperties;
|
||||
|
||||
|
||||
@Autowired
|
||||
private AmqpMessageHandlerService amqpMessageHandlerService;
|
||||
|
||||
@Test
|
||||
@Description("Tests DMF PING request and expected reponse.")
|
||||
@Description("Tests DMF PING request and expected response.")
|
||||
public void pingDmfInterface() {
|
||||
final Message pingMessage = createPingMessage(CORRELATION_ID, TENANT_EXIST);
|
||||
getDmfClient().send(pingMessage);
|
||||
@@ -99,8 +99,8 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Tests register target")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 2),
|
||||
@Expect(type = TargetPollEvent.class, count = 3)})
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 2),
|
||||
@Expect(type = TargetPollEvent.class, count = 3) })
|
||||
public void registerTargets() {
|
||||
final String controllerId = TARGET_PREFIX + "registerTargets";
|
||||
registerAndAssertTargetWithExistingTenant(controllerId, 1);
|
||||
@@ -113,8 +113,8 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
}
|
||||
|
||||
@Test
|
||||
@Description("Tests register invalid target withy empty controller id.")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 0)})
|
||||
@Description("Tests register invalid target with empty controller id.")
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) })
|
||||
public void registerEmptyTarget() {
|
||||
createAndSendThingCreated("", TENANT_EXIST);
|
||||
assertAllTargetsCount(0);
|
||||
@@ -122,8 +122,8 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
}
|
||||
|
||||
@Test
|
||||
@Description("Tests register invalid target with whitspace controller id.")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 0)})
|
||||
@Description("Tests register invalid target with whitespace controller id.")
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) })
|
||||
public void registerWhitespaceTarget() {
|
||||
createAndSendThingCreated("Invalid Invalid", TENANT_EXIST);
|
||||
assertAllTargetsCount(0);
|
||||
@@ -132,7 +132,7 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Tests register invalid target with null controller id.")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 0)})
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) })
|
||||
public void registerInvalidNullTarget() {
|
||||
createAndSendThingCreated(null, TENANT_EXIST);
|
||||
assertAllTargetsCount(0);
|
||||
@@ -141,7 +141,7 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Tests register invalid target with too long controller id")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 0)})
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) })
|
||||
public void registerInvalidTargetWithTooLongControllerId() {
|
||||
createAndSendThingCreated(RandomStringUtils.randomAlphabetic(Target.CONTROLLER_ID_MAX_SIZE + 1), TENANT_EXIST);
|
||||
assertAllTargetsCount(0);
|
||||
@@ -150,7 +150,7 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Tests null reply to property in message header. This message should forwarded to the deadletter queue")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 0)})
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) })
|
||||
public void missingReplyToProperty() {
|
||||
final String controllerId = TARGET_PREFIX + "missingReplyToProperty";
|
||||
final Message createTargetMessage = createTargetMessage(controllerId, TENANT_EXIST);
|
||||
@@ -163,7 +163,7 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Tests missing reply to property in message header. This message should forwarded to the deadletter queue")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 0)})
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) })
|
||||
public void emptyReplyToProperty() {
|
||||
final String controllerId = TARGET_PREFIX + "emptyReplyToProperty";
|
||||
final Message createTargetMessage = createTargetMessage(controllerId, TENANT_EXIST);
|
||||
@@ -176,7 +176,7 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Tests missing thing id property in message. This message should forwarded to the deadletter queue")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 0)})
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) })
|
||||
public void missingThingIdProperty() {
|
||||
final Message createTargetMessage = createTargetMessage(null, TENANT_EXIST);
|
||||
createTargetMessage.getMessageProperties().getHeaders().remove(MessageHeaderKey.THING_ID);
|
||||
@@ -188,7 +188,7 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Tests null thing id property in message. This message should forwarded to the deadletter queue")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 0)})
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) })
|
||||
public void nullThingIdProperty() {
|
||||
final Message createTargetMessage = createTargetMessage(null, TENANT_EXIST);
|
||||
getDmfClient().send(createTargetMessage);
|
||||
@@ -199,7 +199,7 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Tests missing tenant message header. This message should forwarded to the deadletter queue")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 0)})
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) })
|
||||
public void missingTenantHeader() {
|
||||
final String controllerId = TARGET_PREFIX + "missingTenantHeader";
|
||||
final Message createTargetMessage = createTargetMessage(controllerId, TENANT_EXIST);
|
||||
@@ -212,7 +212,7 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Tests null tenant message header. This message should forwarded to the deadletter queue")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 0)})
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) })
|
||||
public void nullTenantHeader() {
|
||||
final String controllerId = TARGET_PREFIX + "nullTenantHeader";
|
||||
final Message createTargetMessage = createTargetMessage(controllerId, null);
|
||||
@@ -224,7 +224,7 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Tests empty tenant message header. This message should forwarded to the deadletter queue")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 0)})
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) })
|
||||
public void emptyTenantHeader() {
|
||||
final String controllerId = TARGET_PREFIX + "emptyTenantHeader";
|
||||
final Message createTargetMessage = createTargetMessage(controllerId, "");
|
||||
@@ -236,7 +236,7 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Tests tenant not exist. This message should forwarded to the deadletter queue")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 0)})
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) })
|
||||
public void tenantNotExist() {
|
||||
final String controllerId = TARGET_PREFIX + "tenantNotExist";
|
||||
final Message createTargetMessage = createTargetMessage(controllerId, "TenantNotExist");
|
||||
@@ -248,7 +248,7 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Tests missing type message header. This message should forwarded to the deadletter queue")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 0)})
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) })
|
||||
public void missingTypeHeader() {
|
||||
final Message createTargetMessage = createTargetMessage(null, TENANT_EXIST);
|
||||
createTargetMessage.getMessageProperties().getHeaders().remove(MessageHeaderKey.TYPE);
|
||||
@@ -260,7 +260,7 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Tests null type message header. This message should forwarded to the deadletter queue")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 0)})
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) })
|
||||
public void nullTypeHeader() {
|
||||
final Message createTargetMessage = createTargetMessage(null, TENANT_EXIST);
|
||||
createTargetMessage.getMessageProperties().getHeaders().put(MessageHeaderKey.TYPE, null);
|
||||
@@ -272,7 +272,7 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Tests empty type message header. This message should forwarded to the deadletter queue")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 0)})
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) })
|
||||
public void emptyTypeHeader() {
|
||||
final Message createTargetMessage = createTargetMessage(null, TENANT_EXIST);
|
||||
createTargetMessage.getMessageProperties().getHeaders().put(MessageHeaderKey.TYPE, "");
|
||||
@@ -284,7 +284,7 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Tests invalid type message header. This message should forwarded to the deadletter queue")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 0)})
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) })
|
||||
public void invalidTypeHeader() {
|
||||
final Message createTargetMessage = createTargetMessage(null, TENANT_EXIST);
|
||||
createTargetMessage.getMessageProperties().getHeaders().put(MessageHeaderKey.TYPE, "NotExist");
|
||||
@@ -296,7 +296,7 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Tests null topic message header. This message should forwarded to the deadletter queue")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 0)})
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) })
|
||||
public void nullTopicHeader() {
|
||||
final Message eventMessage = createEventMessage(TENANT_EXIST, EventTopic.UPDATE_ACTION_STATUS, "");
|
||||
eventMessage.getMessageProperties().getHeaders().put(MessageHeaderKey.TOPIC, null);
|
||||
@@ -307,7 +307,7 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Tests null topic message header. This message should forwarded to the deadletter queue")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 0)})
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) })
|
||||
public void emptyTopicHeader() {
|
||||
final Message eventMessage = createEventMessage(TENANT_EXIST, EventTopic.UPDATE_ACTION_STATUS, "");
|
||||
eventMessage.getMessageProperties().getHeaders().put(MessageHeaderKey.TOPIC, "");
|
||||
@@ -318,7 +318,7 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Tests null topic message header. This message should forwarded to the deadletter queue")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 0)})
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) })
|
||||
public void invalidTopicHeader() {
|
||||
final Message eventMessage = createEventMessage(TENANT_EXIST, EventTopic.UPDATE_ACTION_STATUS, "");
|
||||
eventMessage.getMessageProperties().getHeaders().put(MessageHeaderKey.TOPIC, "NotExist");
|
||||
@@ -329,7 +329,7 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Tests missing topic message header. This message should forwarded to the deadletter queue")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 0)})
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) })
|
||||
public void missingTopicHeader() {
|
||||
final Message eventMessage = createEventMessage(TENANT_EXIST, EventTopic.UPDATE_ACTION_STATUS, "");
|
||||
eventMessage.getMessageProperties().getHeaders().remove(MessageHeaderKey.TOPIC);
|
||||
@@ -340,7 +340,7 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Tests invalid null message content. This message should forwarded to the deadletter queue")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 0)})
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) })
|
||||
public void updateActionStatusWithNullContent() {
|
||||
final Message eventMessage = createEventMessage(TENANT_EXIST, EventTopic.UPDATE_ACTION_STATUS, null);
|
||||
getDmfClient().send(eventMessage);
|
||||
@@ -349,7 +349,7 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Tests invalid empty message content. This message should forwarded to the deadletter queue")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 0)})
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) })
|
||||
public void updateActionStatusWithEmptyContent() {
|
||||
final Message eventMessage = createEventMessage(TENANT_EXIST, EventTopic.UPDATE_ACTION_STATUS, "");
|
||||
getDmfClient().send(eventMessage);
|
||||
@@ -358,7 +358,7 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Tests invalid json message content. This message should forwarded to the deadletter queue")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 0)})
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) })
|
||||
public void updateActionStatusWithInvalidJsonContent() {
|
||||
final Message eventMessage = createEventMessage(TENANT_EXIST, EventTopic.UPDATE_ACTION_STATUS,
|
||||
"Invalid Content");
|
||||
@@ -368,7 +368,7 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Tests invalid topic message header. This message should forwarded to the deadletter queue")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 0)})
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) })
|
||||
public void updateActionStatusWithInvalidActionId() {
|
||||
final DmfActionUpdateStatus actionUpdateStatus = new DmfActionUpdateStatus(1L, DmfActionStatus.RUNNING);
|
||||
final Message eventMessage = createEventMessage(TENANT_EXIST, EventTopic.UPDATE_ACTION_STATUS,
|
||||
@@ -379,98 +379,98 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Tests register target and send finished message")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetAssignDistributionSetEvent.class, count = 1),
|
||||
@Expect(type = ActionUpdatedEvent.class, count = 1), @Expect(type = ActionCreatedEvent.class, count = 1),
|
||||
@Expect(type = SoftwareModuleCreatedEvent.class, count = 3),
|
||||
@Expect(type = SoftwareModuleUpdatedEvent.class, count = 6),
|
||||
@Expect(type = DistributionSetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetAttributesRequestedEvent.class, count = 1),
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 2), @Expect(type = TargetPollEvent.class, count = 1)})
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 2), @Expect(type = TargetPollEvent.class, count = 1) })
|
||||
public void finishActionStatus() {
|
||||
final String controllerId = TARGET_PREFIX + "finishActionStatus";
|
||||
registerTargetAndSendAndAssertUpdateActionStatus(DmfActionStatus.FINISHED, Status.FINISHED, controllerId);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Description("Register a target and send a update action status (running). Verfiy if the updated action status is correct.")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@Description("Register a target and send a update action status (running). Verify if the updated action status is correct.")
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetAssignDistributionSetEvent.class, count = 1),
|
||||
@Expect(type = ActionUpdatedEvent.class, count = 0), @Expect(type = ActionCreatedEvent.class, count = 1),
|
||||
@Expect(type = SoftwareModuleCreatedEvent.class, count = 3),
|
||||
@Expect(type = SoftwareModuleUpdatedEvent.class, count = 6),
|
||||
@Expect(type = DistributionSetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 1)})
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 1) })
|
||||
public void runningActionStatus() {
|
||||
final String controllerId = TARGET_PREFIX + "runningActionStatus";
|
||||
registerTargetAndSendAndAssertUpdateActionStatus(DmfActionStatus.RUNNING, Status.RUNNING, controllerId);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Description("Register a target and send an update action status (downloaded). Verfiy if the updated action status is correct.")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@Description("Register a target and send an update action status (downloaded). Verify if the updated action status is correct.")
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetAssignDistributionSetEvent.class, count = 1),
|
||||
@Expect(type = ActionUpdatedEvent.class, count = 0), @Expect(type = ActionCreatedEvent.class, count = 1),
|
||||
@Expect(type = SoftwareModuleCreatedEvent.class, count = 3),
|
||||
@Expect(type = SoftwareModuleUpdatedEvent.class, count = 6),
|
||||
@Expect(type = DistributionSetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 1)})
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 1) })
|
||||
public void downloadedActionStatus() {
|
||||
final String controllerId = TARGET_PREFIX + "downloadedActionStatus";
|
||||
registerTargetAndSendAndAssertUpdateActionStatus(DmfActionStatus.DOWNLOADED, Status.DOWNLOADED, controllerId);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Description("Register a target and send a update action status (download). Verfiy if the updated action status is correct.")
|
||||
@Description("Register a target and send a update action status (download). Verify if the updated action status is correct.")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetAssignDistributionSetEvent.class, count = 1),
|
||||
@Expect(type = ActionCreatedEvent.class, count = 1),
|
||||
@Expect(type = SoftwareModuleCreatedEvent.class, count = 3),
|
||||
@Expect(type = SoftwareModuleUpdatedEvent.class, count = 6),
|
||||
@Expect(type = DistributionSetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 1)})
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 1) })
|
||||
public void downloadActionStatus() {
|
||||
final String controllerId = TARGET_PREFIX + "downloadActionStatus";
|
||||
registerTargetAndSendAndAssertUpdateActionStatus(DmfActionStatus.DOWNLOAD, Status.DOWNLOAD, controllerId);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Description("Register a target and send a update action status (error). Verfiy if the updated action status is correct.")
|
||||
@Description("Register a target and send a update action status (error). Verify if the updated action status is correct.")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetAssignDistributionSetEvent.class, count = 1),
|
||||
@Expect(type = ActionUpdatedEvent.class, count = 1), @Expect(type = ActionCreatedEvent.class, count = 1),
|
||||
@Expect(type = SoftwareModuleCreatedEvent.class, count = 3),
|
||||
@Expect(type = SoftwareModuleUpdatedEvent.class, count = 6),
|
||||
@Expect(type = DistributionSetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 2), @Expect(type = TargetPollEvent.class, count = 1)})
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 2), @Expect(type = TargetPollEvent.class, count = 1) })
|
||||
public void errorActionStatus() {
|
||||
final String controllerId = TARGET_PREFIX + "errorActionStatus";
|
||||
registerTargetAndSendAndAssertUpdateActionStatus(DmfActionStatus.ERROR, Status.ERROR, controllerId);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Description("Register a target and send a update action status (warning). Verfiy if the updated action status is correct.")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@Description("Register a target and send a update action status (warning). Verify if the updated action status is correct.")
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetAssignDistributionSetEvent.class, count = 1),
|
||||
@Expect(type = ActionCreatedEvent.class, count = 1),
|
||||
@Expect(type = SoftwareModuleCreatedEvent.class, count = 3),
|
||||
@Expect(type = SoftwareModuleUpdatedEvent.class, count = 6),
|
||||
@Expect(type = DistributionSetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 1)})
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 1) })
|
||||
public void warningActionStatus() {
|
||||
final String controllerId = TARGET_PREFIX + "warningActionStatus";
|
||||
registerTargetAndSendAndAssertUpdateActionStatus(DmfActionStatus.WARNING, Status.WARNING, controllerId);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Description("Register a target and send a update action status (retrieved). Verfiy if the updated action status is correct.")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@Description("Register a target and send a update action status (retrieved). Verify if the updated action status is correct.")
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetAssignDistributionSetEvent.class, count = 1),
|
||||
@Expect(type = ActionCreatedEvent.class, count = 1),
|
||||
@Expect(type = SoftwareModuleCreatedEvent.class, count = 3),
|
||||
@Expect(type = SoftwareModuleUpdatedEvent.class, count = 6),
|
||||
@Expect(type = DistributionSetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 1)})
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 1) })
|
||||
public void retrievedActionStatus() {
|
||||
final String controllerId = TARGET_PREFIX + "retrievedActionStatus";
|
||||
registerTargetAndSendAndAssertUpdateActionStatus(DmfActionStatus.RETRIEVED, Status.RETRIEVED, controllerId);
|
||||
@@ -478,13 +478,13 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Register a target and send a invalid update action status (cancel). This message should forwarded to the deadletter queue")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetAssignDistributionSetEvent.class, count = 1),
|
||||
@Expect(type = ActionCreatedEvent.class, count = 1),
|
||||
@Expect(type = SoftwareModuleCreatedEvent.class, count = 3),
|
||||
@Expect(type = SoftwareModuleUpdatedEvent.class, count = 6),
|
||||
@Expect(type = DistributionSetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 1)})
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 1) })
|
||||
public void cancelNotAllowActionStatus() {
|
||||
final String controllerId = TARGET_PREFIX + "cancelNotAllowActionStatus";
|
||||
registerTargetAndSendActionStatus(DmfActionStatus.CANCELED, controllerId);
|
||||
@@ -492,14 +492,14 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
}
|
||||
|
||||
@Test
|
||||
@Description("Verfiy receiving a download and install message if a deployment is done before the target has polled the first time.")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@Description("Verify receiving a download and install message if a deployment is done before the target has polled the first time.")
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetAssignDistributionSetEvent.class, count = 1),
|
||||
@Expect(type = ActionCreatedEvent.class, count = 1),
|
||||
@Expect(type = SoftwareModuleCreatedEvent.class, count = 3),
|
||||
@Expect(type = SoftwareModuleUpdatedEvent.class, count = 6),
|
||||
@Expect(type = DistributionSetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 2)})
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 2) })
|
||||
public void receiveDownLoadAndInstallMessageAfterAssignment() {
|
||||
final String controllerId = TARGET_PREFIX + "receiveDownLoadAndInstallMessageAfterAssignment";
|
||||
|
||||
@@ -518,14 +518,14 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
}
|
||||
|
||||
@Test
|
||||
@Description("Verfiy receiving a download message if a deployment is done with window configured but before maintenance window start time.")
|
||||
@Description("Verify receiving a download message if a deployment is done with window configured but before maintenance window start time.")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetAssignDistributionSetEvent.class, count = 1),
|
||||
@Expect(type = ActionCreatedEvent.class, count = 1),
|
||||
@Expect(type = SoftwareModuleCreatedEvent.class, count = 3),
|
||||
@Expect(type = SoftwareModuleUpdatedEvent.class, count = 6),
|
||||
@Expect(type = DistributionSetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 2)})
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 2) })
|
||||
public void receiveDownloadMessageBeforeMaintenanceWindowStartTime() {
|
||||
final String controllerId = TARGET_PREFIX + "receiveDownLoadMessageBeforeMaintenanceWindowStartTime";
|
||||
|
||||
@@ -546,13 +546,13 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Verify receiving a download_and_install message if a deployment is done with window configured and during maintenance window start time.")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetAssignDistributionSetEvent.class, count = 1),
|
||||
@Expect(type = ActionCreatedEvent.class, count = 1),
|
||||
@Expect(type = SoftwareModuleCreatedEvent.class, count = 3),
|
||||
@Expect(type = SoftwareModuleUpdatedEvent.class, count = 6),
|
||||
@Expect(type = DistributionSetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 2)})
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 2) })
|
||||
public void receiveDownloadAndInstallMessageDuringMaintenanceWindow() {
|
||||
final String controllerId = TARGET_PREFIX + "receiveDownLoadAndInstallMessageDuringMaintenanceWindow";
|
||||
|
||||
@@ -572,15 +572,15 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
}
|
||||
|
||||
@Test
|
||||
@Description("Verfiy receiving a cancel update message if a deployment is canceled before the target has polled the first time.")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@Description("Verify receiving a cancel update message if a deployment is canceled before the target has polled the first time.")
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetAssignDistributionSetEvent.class, count = 1),
|
||||
@Expect(type = ActionCreatedEvent.class, count = 1),
|
||||
@Expect(type = SoftwareModuleCreatedEvent.class, count = 3),
|
||||
@Expect(type = DistributionSetCreatedEvent.class, count = 1),
|
||||
@Expect(type = CancelTargetAssignmentEvent.class, count = 1),
|
||||
@Expect(type = ActionUpdatedEvent.class, count = 1), @Expect(type = TargetUpdatedEvent.class, count = 1),
|
||||
@Expect(type = TargetPollEvent.class, count = 2)})
|
||||
@Expect(type = TargetPollEvent.class, count = 2) })
|
||||
public void receiveCancelUpdateMessageAfterAssignmentWasCanceled() {
|
||||
final String controllerId = TARGET_PREFIX + "receiveCancelUpdateMessageAfterAssignmentWasCanceled";
|
||||
|
||||
@@ -601,14 +601,14 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Register a target and send a invalid update action status (canceled). The current status (pending) is not a canceling state. This message should forwarded to the deadletter queue")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetAssignDistributionSetEvent.class, count = 1),
|
||||
@Expect(type = ActionUpdatedEvent.class, count = 1), @Expect(type = ActionCreatedEvent.class, count = 1),
|
||||
@Expect(type = SoftwareModuleCreatedEvent.class, count = 3),
|
||||
@Expect(type = SoftwareModuleUpdatedEvent.class, count = 6),
|
||||
@Expect(type = CancelTargetAssignmentEvent.class, count = 1),
|
||||
@Expect(type = DistributionSetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 1)})
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 1) })
|
||||
public void actionNotExists() {
|
||||
final String controllerId = TARGET_PREFIX + "actionNotExists";
|
||||
|
||||
@@ -621,13 +621,13 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Register a target and send a invalid update action status (cancel_rejected). This message should forwarded to the deadletter queue")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetAssignDistributionSetEvent.class, count = 1),
|
||||
@Expect(type = ActionCreatedEvent.class, count = 1),
|
||||
@Expect(type = SoftwareModuleCreatedEvent.class, count = 3),
|
||||
@Expect(type = SoftwareModuleUpdatedEvent.class, count = 6),
|
||||
@Expect(type = DistributionSetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 1)})
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 1) })
|
||||
public void canceledRejectedNotAllowActionStatus() {
|
||||
final String controllerId = TARGET_PREFIX + "canceledRejectedNotAllowActionStatus";
|
||||
registerTargetAndSendActionStatus(DmfActionStatus.CANCEL_REJECTED, controllerId);
|
||||
@@ -635,15 +635,15 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
}
|
||||
|
||||
@Test
|
||||
@Description("Register a target and send a valid update action status (cancel_rejected). Verfiy if the updated action status is correct.")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@Description("Register a target and send a valid update action status (cancel_rejected). Verify if the updated action status is correct.")
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetAssignDistributionSetEvent.class, count = 1),
|
||||
@Expect(type = CancelTargetAssignmentEvent.class, count = 1),
|
||||
@Expect(type = ActionUpdatedEvent.class, count = 1), @Expect(type = ActionCreatedEvent.class, count = 1),
|
||||
@Expect(type = SoftwareModuleCreatedEvent.class, count = 3),
|
||||
@Expect(type = SoftwareModuleUpdatedEvent.class, count = 6),
|
||||
@Expect(type = DistributionSetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 1)})
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 1) })
|
||||
public void canceledRejectedActionStatus() {
|
||||
final String controllerId = TARGET_PREFIX + "canceledRejectedActionStatus";
|
||||
|
||||
@@ -655,8 +655,8 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Verify that sending an update controller attribute message to an existing target works. Verify that different update modes (merge, replace, remove) can be used.")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 4), @Expect(type = TargetPollEvent.class, count = 1)})
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 4), @Expect(type = TargetPollEvent.class, count = 1) })
|
||||
public void updateAttributesWithDifferentUpdateModes() {
|
||||
final String controllerId = TARGET_PREFIX + "updateAttributes";
|
||||
|
||||
@@ -758,8 +758,8 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Verify that sending an update controller attribute message with no thingid header to an existing target does not work.")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 0), @Expect(type = TargetPollEvent.class, count = 1)})
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 0), @Expect(type = TargetPollEvent.class, count = 1) })
|
||||
public void updateAttributesWithNoThingId() {
|
||||
final String controllerId = TARGET_PREFIX + "updateAttributesWithNoThingId";
|
||||
|
||||
@@ -783,8 +783,8 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Verify that sending an update controller attribute message with invalid body to an existing target does not work.")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 0), @Expect(type = TargetPollEvent.class, count = 1)})
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 0), @Expect(type = TargetPollEvent.class, count = 1) })
|
||||
public void updateAttributesWithWrongBody() {
|
||||
|
||||
// setup
|
||||
@@ -825,14 +825,14 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Tests the download_only assignment: tests the handling of a target reporting DOWNLOADED")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetAssignDistributionSetEvent.class, count = 1),
|
||||
@Expect(type = ActionUpdatedEvent.class, count = 1), @Expect(type = ActionCreatedEvent.class, count = 1),
|
||||
@Expect(type = SoftwareModuleCreatedEvent.class, count = 3),
|
||||
@Expect(type = SoftwareModuleUpdatedEvent.class, count = 6),
|
||||
@Expect(type = DistributionSetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetAttributesRequestedEvent.class, count = 1),
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 2), @Expect(type = TargetPollEvent.class, count = 1)})
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 2), @Expect(type = TargetPollEvent.class, count = 1) })
|
||||
public void downloadOnlyAssignmentFinishesActionWhenTargetReportsDownloaded() throws IOException {
|
||||
// create target
|
||||
final String controllerId = TARGET_PREFIX + "registerTargets_1";
|
||||
@@ -855,14 +855,14 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Tests the download_only assignment: tests the handling of a target reporting FINISHED")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetAssignDistributionSetEvent.class, count = 1),
|
||||
@Expect(type = ActionUpdatedEvent.class, count = 2), @Expect(type = ActionCreatedEvent.class, count = 1),
|
||||
@Expect(type = SoftwareModuleCreatedEvent.class, count = 3),
|
||||
@Expect(type = SoftwareModuleUpdatedEvent.class, count = 6),
|
||||
@Expect(type = DistributionSetCreatedEvent.class, count = 1),
|
||||
@Expect(type = TargetAttributesRequestedEvent.class, count = 2),
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 3), @Expect(type = TargetPollEvent.class, count = 1)})
|
||||
@Expect(type = TargetUpdatedEvent.class, count = 3), @Expect(type = TargetPollEvent.class, count = 1) })
|
||||
public void downloadOnlyAssignmentAllowsActionStatusUpdatesWhenTargetReportsFinishedAndUpdatesInstalledDS()
|
||||
throws IOException {
|
||||
|
||||
@@ -894,7 +894,7 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
|
||||
@Test
|
||||
@Description("Messages that result into certain exceptions being raised should not be requeued. This message should forwarded to the deadletter queue")
|
||||
@ExpectEvents({@Expect(type = TargetCreatedEvent.class, count = 0)})
|
||||
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) })
|
||||
public void ignoredExceptionTypesShouldNotBeRequeued() {
|
||||
final ControllerManagement mockedControllerManagement = Mockito.mock(ControllerManagement.class);
|
||||
|
||||
@@ -1010,8 +1010,9 @@ public class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServic
|
||||
}
|
||||
|
||||
private int getAuthenticationMessageCount() {
|
||||
return Integer.parseInt(getRabbitAdmin().getQueueProperties(amqpProperties.getReceiverQueue())
|
||||
.get(RabbitAdmin.QUEUE_MESSAGE_COUNT).toString());
|
||||
return Integer
|
||||
.parseInt(Objects.requireNonNull(getRabbitAdmin().getQueueProperties(amqpProperties.getReceiverQueue()))
|
||||
.get(RabbitAdmin.QUEUE_MESSAGE_COUNT).toString());
|
||||
}
|
||||
|
||||
private void assertEmptyReceiverQueueCount() {
|
||||
|
||||
Reference in New Issue
Block a user