protocols/src/test/java/eu/internetofus/common/protocols/DefaultProtocolsTest.java
/**
   * Check that the task type associated to the protocol are valid.
   *
   * @param protocol    to load.
   * @param vertx       event bus to use.
   * @param testContext context that manage the test.
   */
Check that the task type associated to the protocol are valid.
@param protocol    to load.
@param vertx       event bus to use.
@param testContext context that manage the test.
Check that the task type associated to the protocol are valid . @param protocol to load . @param vertx event bus to use . @param testContext context that manage the test .
@ParameterizedTest(name = "Should {0} be valid")
  @EnumSource(DefaultProtocols.class)
  public void shouldProtocolsBeValid(final DefaultProtocols protocol, final Vertx vertx,
      final VertxTestContext testContext) {
    testContext.assertComplete(protocol.load(vertx)).onSuccess(taskType -> {
      testContext.verify(() -> {
        var id = taskType.id;
        assertThat(id).isNotNull();
        id = id.toLowerCase().replaceAll("_", "");
        final var expected = protocol.name().toLowerCase().replaceAll("_", "");
        assertThat(id).isEqualTo(expected);
      });
      taskType.id = null;
      taskType.validate(new WeNetValidateContext("root", vertx))
          .onComplete(testContext.succeeding(empty -> testContext.completeNow()));
    });
  }
@ ParameterizedTest ( name = "Should {0} be valid" ) @ EnumSource ( DefaultProtocols . class ) public void shouldProtocolsBeValid ( final DefaultProtocols protocol , final Vertx vertx , final VertxTestContext testContext ) { testContext . assertComplete ( protocol . load ( vertx ) ) . onSuccess ( taskType -> { testContext . verify ( ( ) -> { var id = taskType . id ; assertThat ( id ) . isNotNull ( ) ; id = id . toLowerCase ( ) . replaceAll ( "_" , "" ) ; final var expected = protocol . name ( ) . toLowerCase ( ) . replaceAll ( "_" , "" ) ; assertThat ( id ) . isEqualTo ( expected ) ; } ) ; taskType . id = null ; taskType . validate ( new WeNetValidateContext ( "root" , vertx ) ) . onComplete ( testContext . succeeding ( empty -> testContext . completeNow ( ) ) ) ; } ) ; }
Check that the task type associated to the protocol are valid.
Check that the task type associated to the protocol are valid .