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
package io.github.aptushkin.proxy.image.filter | |
import org.springframework.cloud.gateway.filter.GatewayFilter | |
import org.springframework.cloud.gateway.filter.GatewayFilterChain | |
import org.springframework.cloud.gateway.filter.RouteToRequestUrlFilter.ROUTE_TO_URL_FILTER_ORDER | |
import org.springframework.cloud.gateway.support.ServerWebExchangeUtils | |
import org.springframework.core.Ordered | |
import org.springframework.web.server.ServerWebExchange | |
import reactor.core.publisher.Mono |
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
@Component | |
class ProxyForwardGatewayFilterFactory: | |
AbstractGatewayFilterFactory<AbstractGatewayFilterFactory.NameConfig>(NameConfig::class.java) { | |
override fun apply(config: NameConfig): GatewayFilter = ProxyForwardGatewayFilter() | |
} |
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
spring.cloud.gateway: | |
filters: | |
- name: ExampleFilter | |
args: | |
foo: "amazing" | |
baz: 1 |
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
spring: | |
cloud: | |
gateway: | |
routes: | |
- id: modify_image_router | |
uri: http://my-image-server.org | |
predicates: | |
- Path=/rotate | |
filters: | |
- name: RotateImage |
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
spring: | |
cloud: | |
gateway: | |
default-filters: | |
- ProxyForward | |
routes: | |
- id: modify_image_router | |
uri: no://op | |
predicates: | |
- Path=/** |
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
@Test | |
public void hibernate() throws Exception { | |
UUID id = fromString("b80db28f-2e4f-4d18-bb96-6bc5b9b387cb"); | |
EntityManager entityManager = entityManagerProvider.get(); | |
ObjectMapper objectMapper = new ObjectMapper(); | |
doAnswer(new Answer<Void>() { | |
@Override | |
public Void answer(InvocationOnMock invocation) throws Throwable { | |
Object[] args = invocation.getArguments(); |
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
Maven | Gradle | |
---|---|---|
group-id | project.group | |
artifact-id | project.name | |
version | project.version |
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
Direct dependency | Transitive dependency | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Gradle configurations | Maven scope | Requirements | Artifact inclusion | Compile classpath | Runtime classpath | Test compile classpath | Test runtime classpath | Compile classpath | Runtime classpath | ||
implementation | runtime | yes | + | + | + | + | + | ||||
api | compile | plugins: id 'java-library' | yes | + | + | + | + | + | + | ||
compile | compile | yes | + | + | + | + | + | + | |||
compileOnly | - | no | + | ||||||||
runtimeOnly | runtime | yes | + | + | + | ||||||
providedCompile | provided | plugins: id 'war' | no | + | + | + | + | ||||
providedRuntime | provided | plugins: id 'war' | no | + | + | ||||||
testImplementation | test | no | + | + |
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 TariffClientPactTest { | |
@Rule | |
public PactProviderRule pactProviderRule = new PactProviderRule("billing", "localhost", 8080, this); | |
@Pact(provider = "billing", consumer = "transactions") | |
public RequestResponsePact itProvidesTariffPact(PactDslWithProvider pactDsl) { | |
return pactDsl | |
.given("tariff-for-transactions") | |
.uponReceiving("get tariff") | |
.path("/billing/tariffs/04974939-2630-4cb3-b2d0-baac27842172") |
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(RestPactRunner.class) | |
@Provider("billing") | |
@PactBroker(consumerVersionSelectors = { | |
@VersionSelector(consumer = "transactions") | |
}) | |
public class TariffProviderPactTest { | |
@Autowired | |
private TariffRepository tariffRepository; | |
@TestTarget | |
public final Target target = new HttpTarget("http", "localhost", 8080); |
OlderNewer