components/src/test/java/eu/internetofus/common/components/task_manager/WeNetTaskManagerTestCase.java
/**
   * Should create, retrieve and delete a task type.
   *
   * @param vertx       that contains the event bus to use.
   * @param testContext context over the tests.
   */
Should create, retrieve and delete a task type.
@param vertx       that contains the event bus to use.
@param testContext context over the tests.
Should create retrieve and delete a task type . @param vertx that contains the event bus to use . @param testContext context over the tests .
@Test
  public void shouldCreateRetrieveAndDeleteTaskType(final Vertx vertx, final VertxTestContext testContext) {
    final var taskType = new TaskTypeTest().createModelExample(1);
    taskType.id = null;
    final var service = this.createComponentProxy(vertx);
    testContext.assertComplete(service.createTaskType(taskType)).onSuccess(create -> {
      final var id = create.id;
      testContext.assertComplete(service.retrieveTaskType(id)).onSuccess(retrieve -> testContext.verify(() -> {
        assertThat(create).isEqualTo(retrieve);
        testContext.assertComplete(service.deleteTaskType(id)).onSuccess(empty -> {
          testContext.assertFailure(service.retrieveTaskType(id)).onFailure(handler -> testContext.completeNow());
        });
      }));
    });
  }
@ Test public void shouldCreateRetrieveAndDeleteTaskType ( final Vertx vertx , final VertxTestContext testContext ) { final var taskType = new TaskTypeTest ( ) . createModelExample ( 1 ) ; taskType . id = null ; final var service = this . createComponentProxy ( vertx ) ; testContext . assertComplete ( service . createTaskType ( taskType ) ) . onSuccess ( create -> { final var id = create . id ; testContext . assertComplete ( service . retrieveTaskType ( id ) ) . onSuccess ( retrieve -> testContext . verify ( ( ) -> { assertThat ( create ) . isEqualTo ( retrieve ) ; testContext . assertComplete ( service . deleteTaskType ( id ) ) . onSuccess ( empty -> { testContext . assertFailure ( service . retrieveTaskType ( id ) ) . onFailure ( handler -> testContext . completeNow ( ) ) ; } ) ; } ) ) ; } ) ; }
Should create, retrieve and delete a task type.
Should create retrieve and delete a task type .