Skip to content

Commit

Permalink
fix: use new execution mode V4 Emulation
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumelamirand committed Jun 29, 2023
1 parent 35c88d2 commit daa50ce
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 38 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<gravitee-apim.version>4.0.0-SNAPSHOT</gravitee-apim.version>
<gravitee-sse.version>3.1.0-alpha.3</gravitee-sse.version>
<gravitee-http-post.version>1.0.0-alpha.2</gravitee-http-post.version>
<gravitee-reactor-message.version>1.0.0-alpha.7</gravitee-reactor-message.version>
<gravitee-reactor-message.version>1.0.0-archi-254-remove-jupiter-SNAPSHOT</gravitee-reactor-message.version>

<json-schema-generator-maven-plugin.version>1.3.0</json-schema-generator-maven-plugin.version>
<json-schema-generator-maven-plugin.outputDirectory>${project.build.directory}/schemas</json-schema-generator-maven-plugin.outputDirectory>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import io.gravitee.apim.gateway.tests.sdk.annotations.DeployApi;
import io.gravitee.apim.gateway.tests.sdk.annotations.GatewayTest;
import io.gravitee.apim.gateway.tests.sdk.configuration.GatewayConfigurationBuilder;
import io.gravitee.apim.gateway.tests.sdk.configuration.GatewayMode;
import io.gravitee.apim.gateway.tests.sdk.reporter.FakeReporter;
import io.gravitee.definition.model.Api;
import io.gravitee.definition.model.ExecutionMode;
Expand All @@ -47,22 +48,10 @@
* @author Yann TAVERNIER (yann.tavernier at graviteesource.com)
* @author GraviteeSource Team
*/
@GatewayTest
@GatewayTest(v2ExecutionMode = ExecutionMode.V3)
@DeployApi("/apis/latency-v2.json")
class LatencyPolicyIntegrationV3Test extends AbstractPolicyTest<LatencyPolicy, LatencyPolicyConfiguration> {

@Override
protected void configureGateway(GatewayConfigurationBuilder gatewayConfigurationBuilder) {
super.configureGateway(gatewayConfigurationBuilder);
gatewayConfigurationBuilder.set("api.jupiterMode.enabled", "false");
}

@Override
public void configureApi(Api api) {
super.configureApi(api);
api.setExecutionMode(ExecutionMode.V3);
}

@Test
void should_apply_latency_on_request(HttpClient httpClient, VertxTestContext vertxTestContext) throws InterruptedException {
Checkpoint fakeReporterCheckpoint = vertxTestContext.checkpoint();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,12 @@
*/
package io.gravitee.policy.latency;

import io.gravitee.apim.gateway.tests.sdk.annotations.DeployApi;
import io.gravitee.apim.gateway.tests.sdk.annotations.GatewayTest;
import io.gravitee.apim.gateway.tests.sdk.configuration.GatewayConfigurationBuilder;
import io.gravitee.definition.model.Api;
import io.gravitee.definition.model.ExecutionMode;
import io.gravitee.apim.gateway.tests.sdk.configuration.GatewayMode;

/**
* @author Guillaume Lamirand (guillaume.lamirand at graviteesource.com)
* @author GraviteeSource Team
*/
class LatencyPolicyIntegrationV4CompatibilityTest extends LatencyPolicyIntegrationV3Test {

@Override
protected void configureGateway(GatewayConfigurationBuilder gatewayConfigurationBuilder) {
super.configureGateway(gatewayConfigurationBuilder);
gatewayConfigurationBuilder.set("api.jupiterMode.enabled", "true");
}

@Override
public void configureApi(Api api) {
super.configureApi(api);
api.setExecutionMode(ExecutionMode.JUPITER);
}
}
@GatewayTest
class LatencyPolicyIntegrationV4EmulationTest extends LatencyPolicyIntegrationV3Test {}
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,6 @@ void afterEach() {
fakeReporter.reset();
}

@Override
protected void configureGateway(GatewayConfigurationBuilder gatewayConfigurationBuilder) {
super.configureGateway(gatewayConfigurationBuilder);
gatewayConfigurationBuilder.set("api.jupiterMode.enabled", "true");
}

@Override
public void configureReactors(Set<ReactorPlugin<? extends ReactorFactory<?>>> reactors) {
reactors.add(ReactorBuilder.build(MessageApiReactorFactory.class));
Expand Down

0 comments on commit daa50ce

Please sign in to comment.