/bcn-jug-allure-junit5

Informes con Allure y JUnit5

Primary LanguageJavaApache License 2.0Apache-2.0

Para español, haga clic aquí 🇪🇸

Project title

Test report using Allure and JUnit5

Motivation

Share the experience using Allure

Build status

allure-junit5-maven

Quality Gate

Quality Gate Status

Tech/framework used

Built with

Features

Payment

Code Example

@Feature("Payment")
class PaymentServiceTest {

    @Test
    @DisplayName("Debit and transfer funds")
    @Severity(SeverityLevel.BLOCKER)
    void debitAccountAndTransferFunds() {
        double amount = 42;

        service.debitAccountAndTransferFunds(buyer, seller, amount);

        verify(buyer, atLeastOnce()).balanceOperation(Operation.DEBIT, amount);
        verify(seller, atLeastOnce()).balanceOperation(Operation.CREDIT, amount);

    }

    @Test
    @DisplayName("Prepare for payment")
    @Severity(SeverityLevel.NORMAL)
    void prepareForPayment() {
        Throwable throwable =
                assertThrows(
                        UnsupportedOperationException.class,
                        () -> service.prepareForPayment());
        assertNull(throwable.getMessage());
    }
}

Run locally

  • Download the project through the GitHub using
git clone https://github.com/luizgustavocosta/bcn-jug-allure-junit5.git
  • Fix the failed test on InMemoryStoreTest class, if any.
    @Test
    @Severity(SeverityLevel.TRIVIAL)
    void findAll() {
        assertNotNull(null);
    }
  • Go to project folder
cd bcn-jug-allure-junit5
  • And then execute
mvn clean verify allure:serve
  • A new page will be open showing the report

Allure Report

References