Feature add missing entity events (#640)

* introduce CRD event interfaces and add missing events for entities

Signed-off-by: Michael Hirsch <michael.hirsch@bosch-si.com>

* extend EntityIdEvent by TenantAwareEvent

Signed-off-by: Michael Hirsch <michael.hirsch@bosch-si.com>

* add tests for additional events and skip test preperation events

Signed-off-by: Michael Hirsch <michael.hirsch@bosch-si.com>

* add missing expected events to tests

Signed-off-by: Michael Hirsch <michael.hirsch@bosch-si.com>

* add target filter query CUD events

Signed-off-by: Michael Hirsch <michael.hirsch@bosch-si.com>

* fix order imports

Signed-off-by: Michael Hirsch <michael.hirsch@bosch-si.com>

* fix javadoc link

Signed-off-by: Michael Hirsch <michael.hirsch@bosch-si.com>

* add neccessary EventType mapping for serialization

Signed-off-by: Michael Hirsch <michael.hirsch@bosch-si.com>
This commit is contained in:
Michael Hirsch
2018-02-26 12:33:41 +01:00
committed by GitHub
parent 87969bdd8f
commit c64a2e7ecc
48 changed files with 768 additions and 94 deletions

View File

@@ -31,7 +31,9 @@ import org.eclipse.hawkbit.repository.event.remote.TargetPollEvent;
import org.eclipse.hawkbit.repository.event.remote.entity.ActionCreatedEvent;
import org.eclipse.hawkbit.repository.event.remote.entity.ActionUpdatedEvent;
import org.eclipse.hawkbit.repository.event.remote.entity.DistributionSetCreatedEvent;
import org.eclipse.hawkbit.repository.event.remote.entity.DistributionSetTypeCreatedEvent;
import org.eclipse.hawkbit.repository.event.remote.entity.SoftwareModuleCreatedEvent;
import org.eclipse.hawkbit.repository.event.remote.entity.SoftwareModuleTypeCreatedEvent;
import org.eclipse.hawkbit.repository.event.remote.entity.TargetCreatedEvent;
import org.eclipse.hawkbit.repository.event.remote.entity.TargetUpdatedEvent;
import org.eclipse.hawkbit.repository.model.Action;
@@ -73,13 +75,15 @@ public class DdiRootControllerTest extends AbstractDDiApiIntegrationTest {
@WithUser(tenantId = "tenantDoesNotExists", allSpPermissions = true, authorities = { CONTROLLER_ROLE,
SYSTEM_ROLE }, autoCreateTenant = false)
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1),
@Expect(type = TargetPollEvent.class, count = 1) })
@Expect(type = TargetPollEvent.class, count = 1),
@Expect(type = DistributionSetTypeCreatedEvent.class, count = 3),
@Expect(type = SoftwareModuleTypeCreatedEvent.class, count = 2) })
public void targetCannotBeRegisteredIfTenantDoesNotExistsButWhenExists() throws Exception {
mvc.perform(get("/default-tenant/", tenantAware.getCurrentTenant())).andDo(MockMvcResultPrinter.print())
.andExpect(status().isNotFound());
// create tenant
// create tenant -- creates softwaremoduletypes and distributionsettypes
systemManagement.getTenantMetadata("tenantDoesNotExists");
mvc.perform(get("/{}/controller/v1/aControllerId", tenantAware.getCurrentTenant()))