Skip to content

luizgustavocosta/bcn-jug-allure-junit5

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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