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
{ | |
"SupportingAccessPoint" : "arn:aws:s3:eu-central-1:012345678912:accesspoint/anonymized-access", | |
"TransformationConfigurations": [{ | |
"Actions" : ["GetObject"], | |
"ContentTransformation" : { | |
"AwsLambda": { | |
"FunctionArn" : "arn:aws:lambda:eu-central-1:012345678912:function:data-anonymizer-AnonymiserFunction-RTHQH8LO8WN9" | |
} | |
} | |
}] |
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
"""Anonymization Lambda function.""" | |
import time | |
from typing import Tuple | |
from faker import Faker | |
from collections import defaultdict | |
from datetime import datetime, date, timedelta | |
from aws_lambda_powertools import Logger | |
import boto3 | |
import requests |
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
public class JourneyBookingE2ET { | |
@Before | |
public void setup() { | |
RestAssured.baseURI = "http://localhost"; | |
RestAssured.port = 8081; | |
RestAssured.basePath = "/journeys"; | |
} | |
@Test |
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
RunWith(SpringRunner.class) | |
@SpringBootTest | |
public class ConnectionLookupClientIT { | |
private static final String LAUSANNE = "Lausanne"; | |
private static final String ZURICH = "Zurich"; | |
@Autowired | |
private ConnectionLookupClient client; |
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
@RunWith(SpringRunner.class) | |
@SpringBootTest | |
@Sql(scripts = "/setup_data_integration_test.sql", executionPhase = BEFORE_TEST_METHOD) | |
@Sql(scripts = "/clean_data_integration_test.sql", executionPhase = AFTER_TEST_METHOD) | |
public class JourneyRepositoryIT { | |
@Autowired | |
private JourneyRepository repository; | |
@Test |
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
@RunWith(SpringRunner.class) | |
@ImportAutoConfiguration({RibbonAutoConfiguration.class, | |
FeignRibbonClientAutoConfiguration.class, | |
FeignAutoConfiguration.class}) | |
@SpringBootTest(classes = {ConnectionLookupClient.class, ConfigurationFeign.class}, | |
properties = { | |
"feign.hystrix.enabled=false" | |
} | |
) | |
@AutoConfigureStubRunner(ids = {"ch.octo.blog:connection-lookup:+:stubs:8090"}, stubsMode = StubRunnerProperties.StubsMode.LOCAL) |
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
<dependency> | |
<groupId>org.springframework.cloud</groupId> | |
<artifactId>spring-cloud-starter-contract-stub-runner</artifactId> | |
<scope>test</scope> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework.cloud</groupId> | |
<artifactId>spring-cloud-contract-wiremock</artifactId> | |
</dependency> |
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
@RunWith(SpringRunner.class) | |
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.MOCK) | |
@AutoConfigureJsonTesters | |
public class ContractTestBase { | |
@Autowired | |
private ConnectionsController controller; | |
@MockBean | |
private ConnectionsService service; |
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
public class ContractVerifierTest extends ContractTestBase { | |
@Test | |
public void validate_should_provide_connections() throws Exception { | |
// given: | |
MockMvcRequestSpecification request = given(); | |
// when: | |
ResponseOptions response = given().spec(request) | |
.queryParam("from","Lausanne") |
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.springframework.cloud.contract.spec.Contract | |
import org.springframework.http.MediaType | |
Contract.make { | |
name "should_provide_connections" | |
request { | |
method('GET') | |
url('/connections') { | |
queryParameters { | |
parameter('from', 'Lausanne') |
NewerOlder