protocols/src/test/java/eu/internetofus/common/protocols/DefaultProtocolTest.java
/**
   * Check that cannot load and undefined protocol.
   *
   * @param protocol    mocked value to use in the test.
   * @param vertx       event bus to use.
   * @param testContext context that manage the test.
   */
Check that cannot load and undefined protocol.
@param protocol    mocked value to use in the test.
@param vertx       event bus to use.
@param testContext context that manage the test.
Check that cannot load and undefined protocol . @param protocol mocked value to use in the test . @param vertx event bus to use . @param testContext context that manage the test .
@Test
  public void shouldLoad(@Mock final DefaultProtocol protocol, final Vertx vertx, final VertxTestContext testContext) {
    doReturn("undefined").when(protocol).taskTypeId();
    when(protocol.load(vertx)).thenCallRealMethod();
    protocol.load(vertx).onComplete(testContext.failing(error -> testContext.verify(() -> {
      assertThat(error).isNotNull().isInstanceOf(ValidationErrorException.class);
      assertThat(((ValidationErrorException) error).getCode()).isEqualTo("undefined");
      testContext.completeNow();
    })));
  }
@ Test public void shouldLoad ( @ Mock final DefaultProtocol protocol , final Vertx vertx , final VertxTestContext testContext ) { doReturn ( "undefined" ) . when ( protocol ) . taskTypeId ( ) ; when ( protocol . load ( vertx ) ) . thenCallRealMethod ( ) ; protocol . load ( vertx ) . onComplete ( testContext . failing ( error -> testContext . verify ( ( ) -> { assertThat ( error ) . isNotNull ( ) . isInstanceOf ( ValidationErrorException . class ) ; assertThat ( ( ( ValidationErrorException ) error ) . getCode ( ) ) . isEqualTo ( "undefined" ) ; testContext . completeNow ( ) ; } ) ) ) ; }
Check that cannot load and undefined protocol.
Check that cannot load and undefined protocol .