-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9fe186c
commit b5333b0
Showing
44 changed files
with
211 additions
and
59 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...bloquet/todolist/TodolistApplication.java → ...ava/io/github/gabbloquet/Application.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
package io.github.gabbloquet.todolist; | ||
package io.github.gabbloquet; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
|
||
@SpringBootApplication | ||
public class TodolistApplication { | ||
public class Application { | ||
public static void main(String... args) { | ||
SpringApplication.run(TodolistApplication.class, args); | ||
SpringApplication.run(Application.class, args); | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
service/src/main/java/io/github/gabbloquet/rent/domain/model/Car.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package io.github.gabbloquet.rent.domain.model; | ||
|
||
public record Car(String name, int price) { | ||
} |
16 changes: 16 additions & 0 deletions
16
service/src/main/java/io/github/gabbloquet/rent/domain/model/Customer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package io.github.gabbloquet.rent.domain.model; | ||
|
||
public record Customer(String name) { | ||
public RentalRequest rent(Car car) { | ||
if(car.name().contains("TWINGO")){ | ||
return new RentalRequest( | ||
RentalRequest.Status.VALIDATED, | ||
null | ||
); | ||
} | ||
return new RentalRequest( | ||
RentalRequest.Status.NOT_VALIDATED, | ||
"Numéro de téléphone incompatible" | ||
); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
service/src/main/java/io/github/gabbloquet/rent/domain/model/RentalRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package io.github.gabbloquet.rent.domain.model; | ||
|
||
public record RentalRequest(Status status, String message) { | ||
|
||
public enum Status { | ||
VALIDATED, | ||
NOT_VALIDATED | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...et/todolist/TodolistApplicationTests.java → ...o/github/gabbloquet/ApplicationTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...github/gabbloquet/todolist/TestUtils.java → .../java/io/github/gabbloquet/TestUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
service/src/test/java/io/github/gabbloquet/features/rent/RentSpringTestConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package io.github.gabbloquet.features.rent; | ||
|
||
import org.springframework.boot.test.context.TestConfiguration; | ||
|
||
import static org.mockito.Mockito.mock; | ||
|
||
@TestConfiguration | ||
public class RentSpringTestConfig { | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
service/src/test/java/io/github/gabbloquet/features/rent/RunRentFeatures.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package io.github.gabbloquet.features.rent; | ||
|
||
import io.cucumber.spring.CucumberContextConfiguration; | ||
import org.junit.platform.suite.api.ConfigurationParameter; | ||
import org.junit.platform.suite.api.IncludeEngines; | ||
import org.junit.platform.suite.api.SelectClasspathResource; | ||
import org.junit.platform.suite.api.Suite; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.test.context.ActiveProfiles; | ||
|
||
import static io.cucumber.junit.platform.engine.Constants.GLUE_PROPERTY_NAME; | ||
import static io.cucumber.junit.platform.engine.Constants.PLUGIN_PROPERTY_NAME; | ||
|
||
@Suite | ||
@IncludeEngines("cucumber") | ||
@SelectClasspathResource("features/rent") | ||
@ConfigurationParameter(key = PLUGIN_PROPERTY_NAME, value = "pretty") | ||
@ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "io.github.gabbloquet.features.rent") | ||
public record RunRentFeatures() { | ||
@ActiveProfiles("test") | ||
@CucumberContextConfiguration | ||
@SpringBootTest(classes = RentSpringTestConfig.class) | ||
public record CucumberRentConfiguration() { | ||
} | ||
|
||
} |
53 changes: 53 additions & 0 deletions
53
service/src/test/java/io/github/gabbloquet/features/rent/domain/specs/ValidateRentSpec.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package io.github.gabbloquet.features.rent.domain.specs; | ||
|
||
import io.cucumber.java.fr.Alors; | ||
import io.cucumber.java.fr.Et; | ||
import io.cucumber.java.fr.Etantdonné; | ||
import io.cucumber.java.fr.Quand; | ||
import io.github.gabbloquet.rent.domain.model.Car; | ||
import io.github.gabbloquet.rent.domain.model.Customer; | ||
import io.github.gabbloquet.rent.domain.model.RentalRequest; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
public class ValidateRentSpec { | ||
|
||
private Customer customer; | ||
private Car car; | ||
private RentalRequest rentalRequest; | ||
|
||
@Etantdonné("Mr {string} propriétaire d’un téléphone jetable") | ||
public void mr_propriétaire_d_un_téléphone_jetable(String name) { | ||
this.customer = new Customer(name); | ||
} | ||
|
||
@Etantdonné("Mr {string} ayant un numéro provisoire") | ||
public void mrAyantUnNumeroProvisoire(String name) { | ||
this.customer = new Customer(name); | ||
} | ||
|
||
@Etantdonné("une {string} à {int}€ par mois") | ||
public void une_voiture_a(String carName, int price) { | ||
this.car = new Car(carName, price); | ||
} | ||
|
||
@Quand("Mr {string} demande à louer une {string}") | ||
public void mrDemandeALouerUne(String name, String carName) { | ||
rentalRequest = customer.rent(car); | ||
} | ||
|
||
@Alors("sa demande de location est invalidée") | ||
public void saDemandeDeLocationEstInvalidee() { | ||
assertThat(rentalRequest.status()).isEqualTo(RentalRequest.Status.NOT_VALIDATED); | ||
} | ||
|
||
@Alors("Mr Tapie est informé {string}") | ||
public void mrTapieEstInformeNumeroDeTelephoneIncompatible(String expectedMessage) { | ||
assertThat(rentalRequest.message()).isEqualTo(expectedMessage); | ||
} | ||
|
||
@Alors("sa demande de location est validée") | ||
public void saDemandeDeLocationEstValidee() { | ||
assertThat(rentalRequest.status()).isEqualTo(RentalRequest.Status.VALIDATED); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
service/src/test/java/io/github/gabbloquet/features/todolist/RunTodolistFeatures.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package io.github.gabbloquet.features.todolist; | ||
|
||
import io.cucumber.spring.CucumberContextConfiguration; | ||
import org.junit.platform.suite.api.ConfigurationParameter; | ||
import org.junit.platform.suite.api.IncludeEngines; | ||
import org.junit.platform.suite.api.SelectClasspathResource; | ||
import org.junit.platform.suite.api.Suite; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.test.context.ActiveProfiles; | ||
|
||
import static io.cucumber.junit.platform.engine.Constants.GLUE_PROPERTY_NAME; | ||
import static io.cucumber.junit.platform.engine.Constants.PLUGIN_PROPERTY_NAME; | ||
|
||
@Suite | ||
@IncludeEngines("cucumber") | ||
@SelectClasspathResource("features/todolist") | ||
@ConfigurationParameter(key = PLUGIN_PROPERTY_NAME, value = "pretty") | ||
@ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "io.github.gabbloquet.features.todolist") | ||
public record RunTodolistFeatures() { | ||
@ActiveProfiles("test") | ||
@CucumberContextConfiguration | ||
@SpringBootTest(classes = TodolistSpringTestConfig.class) | ||
public record CucumberTodolistConfiguration() { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...loquet/todolist/domain/ScenarioState.java → ...atures/todolist/domain/ScenarioState.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...et/todolist/domain/specs/AddTaskSpec.java → ...es/todolist/domain/specs/AddTaskSpec.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...dolist/domain/specs/CompleteTaskSpec.java → ...dolist/domain/specs/CompleteTaskSpec.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...todolist/domain/specs/DeleteTaskSpec.java → ...todolist/domain/specs/DeleteTaskSpec.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...odolist/domain/specs/FilterTasksSpec.java → ...odolist/domain/specs/FilterTasksSpec.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ist/domain/specs/OpenApplicationSpec.java → ...ist/domain/specs/OpenApplicationSpec.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...todolist/domain/specs/RenameTaskSpec.java → ...todolist/domain/specs/RenameTaskSpec.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...odolist/domain/specs/ReorderTaskSpec.java → ...odolist/domain/specs/ReorderTaskSpec.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...dolist/domain/specs/TimeTrackingSpec.java → ...dolist/domain/specs/TimeTrackingSpec.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...t/todolist/domain/specs/TodolistSpec.java → ...s/todolist/domain/specs/TodolistSpec.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...list/domain/specs/mappers/TaskMapper.java → ...list/domain/specs/mappers/TaskMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ask/infra/InMemoryTaskRepositoryTest.java → ...ask/infra/InMemoryTaskRepositoryTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...st/filter/TodolistQueriesAdapterTest.java → ...st/filter/TodolistQueriesAdapterTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../infrastructure/api/TaskResourceTest.java → .../infrastructure/api/TaskResourceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...e/api/dto/TodolistResponseMapperTest.java → ...e/api/dto/TodolistResponseMapperTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...loquet/todolist/utils/ArrayUtilsTest.java → ...atures/todolist/utils/ArrayUtilsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
service/src/test/java/io/github/gabbloquet/todolist/domain/CucumberSpringConfiguration.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.