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
import org.craftsrecords.talkadvisor.recommendation.api.CreateProfile | |
import org.craftsrecords.talkadvisor.recommendation.spi.Profiles | |
class ProfileStepdefs(private val testContext: TestContext, | |
private val createProfile: CreateProfile, | |
private val profiles: Profiles) { | |
@Given("^he already has a profile$") | |
fun `he already has a profile`() { | |
val profile = Profile(testContext.userId, createPreferences()) |
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
Feature: As a frequent user, | |
In order not repeat my preferences at each request, | |
I want to create my profile with my preferences | |
Scenario: The user is creating his profile with his preferences | |
Given a user | |
And he wants to learn | |
| DDD | hexagonal architecture | | |
And he only wants to see | |
| QUICKIE | CONFERENCE | |
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
<plugin> | |
<artifactId>kotlin-maven-plugin</artifactId> | |
<groupId>org.jetbrains.kotlin</groupId> | |
<configuration> | |
<compilerPlugins> | |
<plugin>all-open</plugin> | |
</compilerPlugins> | |
<pluginOptions> | |
<option>all-open:annotation=org.craftsrecords.hexarch.DomainService</option> | |
<option>all-open:annotation=org.craftsrecords.hexarch.Stub</option> |
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
@Configuration | |
@ComponentScan( | |
// basePackageClasses = [Recommendation::class], | |
includeFilters = [ComponentScan.Filter(type = FilterType.ANNOTATION, value = [DomainService::class, Stub::class])]) | |
class DomainConfiguration |
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
/** | |
* <p> | |
* A DDD aggregate is a cluster of domain objects that is treated as a | |
* single unit to ensure consistency across them. | |
* </p> | |
* | |
* @see <a href= "https://martinfowler.com/bliki/DDD_Aggregate.html"> | |
* Aggregates in Domain Driven Design | |
* </a> | |
*/ |
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
import java.lang.annotation.Inherited | |
@Retention(AnnotationRetention.RUNTIME) | |
@Target(AnnotationTarget.CLASS) | |
@Inherited | |
annotation class DomainService | |
@Retention(AnnotationRetention.RUNTIME) | |
@Target(AnnotationTarget.CLASS) | |
@Inherited |
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
@Configuration | |
public class DomainConfiguration { | |
@Bean | |
public RetrieveSanitaryGrades retrieveSanitaryGrades() { | |
return new RetrieveSanitaryGrades(); | |
} | |
@Bean | |
public SearchRestaurants restaurantsFinder(Restaurants restaurants, |
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
Select * from users where username='' OR '1'='1' LIMIT 1 --' and password='' |
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
jdbcTemplate | |
.queryForObject( | |
"Select * from users where username='" + name + "' and password='" + password + "'", | |
BeanPropertyRowMapper.newInstance(DBUser.class)); |
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
Feature: Profile endpoint | |
Scenario: creating a profile | |
Given path 'profiles' | |
And request | |
""" | |
{ "topics": [{"name": "DDD"},{"name": "Hexagonal Architecture"}],"talksFormats": ["QUICKIE","CONFERENCE"] } | |
""" | |
When method post | |
Then assert responseStatus == 201 |