Add unit tests to the staff package

The main purpose of this commit is to achieve 100% (line) test
coverage for the staff package.
This commit is contained in:
Denis Natusch 2024-01-06 21:30:15 +01:00
parent 6e4fe14339
commit 2f06261d87
No known key found for this signature in database
GPG key ID: 5E57BD8EDACFA985

View file

@ -0,0 +1,33 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// SPDX-FileCopyrightText: 2024 swt23w23
package catering.staff;
import static org.assertj.core.api.Assertions.assertThat;
import static org.salespointframework.core.Currencies.EURO;
import org.javamoney.moneta.Money;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.annotation.DirtiesContext;
@SpringBootTest
public class StaffUnitTests {
private Employee defaultEmployee;
@Autowired
private StaffManagement staffManagement;
@BeforeEach
void setup() {
defaultEmployee = staffManagement.save(new Employee("Karl Baum", JobType.COOK, Money.of(10, EURO)));
}
@Test
@DirtiesContext
void staffNotEqualToDifferentClass() {
assertThat(defaultEmployee).isNotEqualTo(new Object());
}
}