Documentation
This commit is contained in:
39
src/test/java/de/etecture/ga/GarageAppointmentAppTests.java
Normal file
39
src/test/java/de/etecture/ga/GarageAppointmentAppTests.java
Normal 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");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user