39 lines
1.1 KiB
Java
39 lines
1.1 KiB
Java
package de.etecture.ga;
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
|
|
|
import java.net.URISyntaxException;
|
|
import java.util.Optional;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
|
import de.etecture.ga.model.Garage;
|
|
import de.etecture.ga.repository.GarageRepository;
|
|
|
|
@SpringBootTest
|
|
class GarageAppointmentAppTests {
|
|
|
|
@Autowired
|
|
private GarageRepository garageRepository;
|
|
|
|
@Test
|
|
void contextLoads() {
|
|
}
|
|
|
|
@Test
|
|
void testImportedGarageData() throws URISyntaxException {
|
|
|
|
Optional<Garage> testGarage = garageRepository.findByCode("test-data");
|
|
|
|
assertNotNull(testGarage.get(), "Garage should not be null");
|
|
assertEquals("Test Autohaus", testGarage.get().name());
|
|
assertTrue(testGarage.get().appointments().size() == 18, "Test Autohaus should have 19 appointments");
|
|
assertTrue(testGarage.get().garageServices().size() == 3, "Test Autohaus should have 3 services");
|
|
}
|
|
|
|
}
|