Fix missing TargetUpdate events (#476)

* Fix problem where target assignment sends not all events.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Improved concurrency.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Revert send assigned event change.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Adapt tests.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Readibility.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
Kai Zimmermann
2017-04-12 21:40:48 +02:00
committed by GitHub
parent 84b1980d32
commit 32fe53708e
6 changed files with 111 additions and 94 deletions

View File

@@ -886,7 +886,8 @@ public class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest
.andExpect(status().isOk())
.andExpect(jsonPath("content.[0].id", equalTo(actionStatus.get(0).getId().intValue())))
.andExpect(jsonPath("content.[0].type", equalTo("canceling")))
.andExpect(jsonPath("content.[0].messages", hasItem("manual cancelation requested")))
.andExpect(jsonPath("content.[0].messages",
hasItem("Update Server: cancel obsolete action due to new update")))
.andExpect(jsonPath("content.[0].reportedAt", equalTo(actionStatus.get(0).getCreatedAt())))
.andExpect(jsonPath("content.[1].id", equalTo(actionStatus.get(1).getId().intValue())))
.andExpect(jsonPath("content.[1].type", equalTo("running")))
@@ -912,7 +913,8 @@ public class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest
.andDo(MockMvcResultPrinter.print()).andExpect(status().isOk())
.andExpect(jsonPath("content.[0].id", equalTo(actionStatus.get(1).getId().intValue())))
.andExpect(jsonPath("content.[0].type", equalTo("canceling")))
.andExpect(jsonPath("content.[0].messages", hasItem("manual cancelation requested")))
.andExpect(jsonPath("content.[0].messages",
hasItem("Update Server: cancel obsolete action due to new update")))
.andExpect(jsonPath("content.[0].reportedAt", equalTo(actionStatus.get(1).getCreatedAt())))
.andExpect(jsonPath("content.[1].id", equalTo(actionStatus.get(0).getId().intValue())))
.andExpect(jsonPath("content.[1].type", equalTo("running")))
@@ -929,7 +931,8 @@ public class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest
.andDo(MockMvcResultPrinter.print()).andExpect(status().isOk())
.andExpect(jsonPath("content.[1].id", equalTo(actionStatus.get(1).getId().intValue())))
.andExpect(jsonPath("content.[1].type", equalTo("canceling")))
.andExpect(jsonPath("content.[1].messages", hasItem("manual cancelation requested")))
.andExpect(jsonPath("content.[1].messages",
hasItem("Update Server: cancel obsolete action due to new update")))
.andExpect(jsonPath("content.[1].reportedAt", equalTo(actionStatus.get(1).getCreatedAt())))
.andExpect(jsonPath("content.[0].id", equalTo(actionStatus.get(0).getId().intValue())))
.andExpect(jsonPath("content.[0].type", equalTo("running")))
@@ -956,7 +959,8 @@ public class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest
.andDo(MockMvcResultPrinter.print()).andExpect(status().isOk())
.andExpect(jsonPath("content.[0].id", equalTo(actionStatus.get(1).getId().intValue())))
.andExpect(jsonPath("content.[0].type", equalTo("canceling")))
.andExpect(jsonPath("content.[0].messages", hasItem("manual cancelation requested")))
.andExpect(jsonPath("content.[0].messages",
hasItem("Update Server: cancel obsolete action due to new update")))
.andExpect(jsonPath("content.[0].reportedAt", equalTo(actionStatus.get(1).getCreatedAt())))
.andExpect(jsonPath(JSON_PATH_PAGED_LIST_TOTAL, equalTo(2)))
.andExpect(jsonPath(JSON_PATH_PAGED_LIST_SIZE, equalTo(1)))