Documentation

This commit is contained in:
Matthias Engelien
2024-09-16 07:59:27 +02:00
parent 86ecf3b317
commit ebc66ff8f6
11 changed files with 188 additions and 49 deletions

View File

@@ -0,0 +1,39 @@
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() == 19, "Test Autohaus should have 19 appointments");
assertTrue(testGarage.get().garageServices().size() == 3, "Test Autohaus should have 3 services");
}
}