Commit bea85c3e authored by Angelo Veltens's avatar Angelo Veltens

perform successful check-in

parent 1faaf429
package de.codecentric.ticketscanner;
import org.hibernate.cfg.NotYetImplementedException;
import org.springframework.stereotype.Component;
import java.util.UUID;
@Component
public class TicketScanner {
private final CodeGenerator codeGenerator;
......@@ -26,6 +23,6 @@ public class TicketScanner {
}
public CheckIn checkIn(Code code) {
throw new NotYetImplementedException();
return new CheckIn();
}
}
......@@ -65,8 +65,6 @@ class TicketScannerSpec {
@Nested
@DisplayName("when a code for a registered ticket is scanned")
class ScanCode {
private Ticket foundTicket;
private Ticket registeredTicket;
......@@ -84,4 +82,17 @@ class TicketScannerSpec {
assertThat(foundTicket).isEqualTo(registeredTicket);
}
}
@Nested
@DisplayName("when a check-in is performed for a valid code")
class CheckInValidCode {
@Test
@DisplayName("then the check-in is successful")
void successful_check_in() {
Code knownCode = new Code("KNOWN");
CheckIn checkIn = ticketScanner.checkIn(knownCode);
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