Commit 86569ded authored by Angelo Veltens's avatar Angelo Veltens

ticket scanner acceptance test

parent 2bf2c57e
package de.codecentric.ticketscanner;
import lombok.EqualsAndHashCode;
@EqualsAndHashCode
public class CheckIn {
public boolean isSuccessful() {
return true;
}
}
package de.codecentric.ticketscanner;
import org.hibernate.cfg.NotYetImplementedException;
import org.springframework.stereotype.Component;
@Component
public class TicketScanner {
public Code register(Ticket ticket) {
return null;
throw new NotYetImplementedException();
}
public Ticket scan(Code code) {
throw new NotYetImplementedException();
}
public CheckIn checkIn(Code code) {
throw new NotYetImplementedException();
}
}
package de.codecentric.ticketscanner;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.junit.MockitoJUnitRunner;
import java.util.UUID;
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
@RunWith(MockitoJUnitRunner.class)
public class TicketScannerFeature {
@Test
public void successful_check_in_with_valid_ticket() {
// given
TicketScanner ticketScanner = new TicketScanner();
Ticket registeredTicket = new Ticket(UUID.randomUUID());
// when
Code code = ticketScanner.register(registeredTicket);
Ticket scannedTicket = ticketScanner.scan(code);
CheckIn checkIn = ticketScanner.checkIn(code);
// then
assertThat(scannedTicket).isEqualTo(registeredTicket);
assertThat(checkIn.isSuccessful()).isTrue();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment