Skip to content

Commit

Permalink
Merge pull request #78 from akka/main
Browse files Browse the repository at this point in the history
docs: publish latest updates
  • Loading branch information
beritou authored Dec 11, 2024
2 parents cc222e9 + e5beb95 commit 5124cbb
Show file tree
Hide file tree
Showing 49 changed files with 163 additions and 62 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ jobs:
fi
if [ true == '${{matrix.it}}' ]; then
${PRE_CMD}
KALIX_TESTKIT_DEBUG=true mvn verify -Pit --no-transfer-progress
KALIX_TESTKIT_DEBUG=true mvn integration-test --no-transfer-progress
fi
- name: ${{ matrix.sample }} rm & test-compile
Expand All @@ -450,5 +450,5 @@ jobs:
export SDK_VERSION=$(cat ~/akka-javasdk-version.txt)
cd samples/${DIR}
echo "==== Verifying that generated unmanaged sources compile ===="
rm -rf src/main/java src/test/java src/it/java
rm -rf src/main/java src/test/java
mvn test-compile --no-transfer-progress
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</includes>
</fileSet>
<fileSet filtered="true">
<directory>src/it/java</directory>
<directory>src/test/java</directory>
<includes>
<include>**/*</include>
</includes>
Expand Down
57 changes: 35 additions & 22 deletions akka-javasdk-maven/akka-javasdk-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,6 @@


<build>
<resources>
<resource>
<directory>${basedir}/src/main/resources</directory>
</resource>
</resources>

<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
Expand Down Expand Up @@ -284,7 +278,27 @@
</systemPropertyVariables>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-failsafe-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
</goals>
<configuration>
<includes>
<include>**/*IntegrationTest.java</include>
<include>**/*IT.java</include>
<include>**/IT*.java</include>
<include>**/*ITCase.java</include>
</includes>
<argLine>-Dlogback.configurationFile=${logback.configurationFile} -Dakka.javasdk.dev-mode.project-artifact-id=${project.artifactId}</argLine>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
Expand Down Expand Up @@ -334,6 +348,11 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -359,36 +378,30 @@
<profiles>

<profile>
<!-- run Integration Tests in src/it/java with `mvn verify -Pit`-->
<id>it</id>
<build>
<plugins>
<plugin>
<!-- run *IntegrationTest with failsafe -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-failsafe-plugin.version}</version>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>groovy-maven-plugin</artifactId>
<version>2.1.1</version>
<executions>
<execution>
<phase>integration-test</phase>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
<goal>execute</goal>
</goals>
<configuration>
<includes>
<include>**/*IntegrationTest</include>
</includes>
<argLine>-Dlogback.configurationFile=${logback.configurationFile} -Dakka.javasdk.dev-mode.project-artifact-id=${project.artifactId}</argLine>
<source>
log.warn('The 'it' profile is deprecated. It will be removed in future versions. Integration tests only need `mvn integration-test` to run.')
</source>
</configuration>
</execution>
</executions>
<configuration>
<classesDirectory>${project.build.outputDirectory}</classesDirectory>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profile>

<profile>
<id>clean-on-missing-descriptor</id>
Expand Down
4 changes: 2 additions & 2 deletions docs/src/modules/java/pages/access-control.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,9 @@ ACL rules will be applied whenever a call is made using testkit's `HttpClient`.
originating from the internet. You can disable the ACL checks by overriding the `testKitSettings()` method.

[source, java, indent=0]
.{sample-base-url}/doc-snippets/src/it/java/com/example/acl/UserEndpointIntegrationTest.java[UserEndpointIntegrationTest.java]
.{sample-base-url}/doc-snippets/src/test/java/com/example/acl/UserEndpointIntegrationTest.java[UserEndpointIntegrationTest.java]
----
include::example$doc-snippets/src/it/java/com/example/acl/UserEndpointIntegrationTest.java[tag=disable-acl-in-it]
include::example$doc-snippets/src/test/java/com/example/acl/UserEndpointIntegrationTest.java[tag=disable-acl-in-it]
----

Calls made through the `ComponentClient` are internal to the service and therefore no ACL rule is applied.
4 changes: 2 additions & 2 deletions docs/src/modules/java/pages/auth-with-jwts.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ When running locally, by default, a dev key with id `dev` is configured for use.
When running integration tests, JWTs will still be enforced but its signature will not be validated, similarly to what is described above for when running locally. Thus, when making calls in the context of integration testing, make sure to inject a proper token with the required claims, as shown below:

[source, java, indent=0]
.{sample-base-url}/endpoint-jwt/src/it/java/hellojwt/api/HelloJwtIntegrationTest.java[HelloJwtIntegrationTest.java]
.{sample-base-url}/endpoint-jwt/src/test/java/hellojwt/api/HelloJwtIntegrationTest.java[HelloJwtIntegrationTest.java]
----
include::example$endpoint-jwt/src/it/java/hellojwt/api/HelloJwtIntegrationTest.java[tag=bearer-token-claims-test]
include::example$endpoint-jwt/src/test/java/hellojwt/api/HelloJwtIntegrationTest.java[tag=bearer-token-claims-test]
----
<1> Use a helper method to create a JWT token with 2 claims: issuer and subject.
<2> Inject the bearer token as header with the key `Authorization`.
Expand Down
22 changes: 11 additions & 11 deletions docs/src/modules/java/pages/consuming-producing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ If a Consumer produce messages of `byte[]` type to a topic, the messages publish
Producing to a topic is the same as producing to a stream in service to service eventing. The only difference is the `@Produce.ToTopic` annotation. Used to set a destination topic name.
IMPORTANT: To guarantee that events for each entity can be read from the message broker in the same order they were written the cloud event subject id must be specified in metadata along with the event. Se how to in xref:consuming-producing.adoc#_metadata[Metadata] below.
IMPORTANT: To guarantee that events for each entity can be read from the message broker in the same order they were written, the cloud event subject id must be specified in metadata along with the event. See how to in xref:consuming-producing.adoc#_metadata[Metadata] below.
[source,java,indent=0]
.{sample-base-url}/event-sourced-counter-brokers/src/main/java/counter/application/CounterJournalToTopicConsumer.java[CounterJournalToTopicConsumer.java]
Expand Down Expand Up @@ -234,9 +234,9 @@ In this example:
To test this flow, we will take advantage of the TestKit to be able to push commands into the `event-commands` topic and check what messages are produced to topic `counter-events`.
[source,java]
.{sample-base-url}/event-sourced-counter-brokers/src/it/java/counter/application/CounterIntegrationTest.java[CounterIntegrationTest.java]
.{sample-base-url}/event-sourced-counter-brokers/src/test/java/counter/application/CounterIntegrationTest.java[CounterIntegrationTest.java]
----
include::example$event-sourced-counter-brokers/src/it/java/counter/application/CounterIntegrationTest.java[tags=class;test-topic]
include::example$event-sourced-counter-brokers/src/test/java/counter/application/CounterIntegrationTest.java[tags=class;test-topic]
----
<1> Use the TestKitSupport class.
<2> Get a `IncomingMessages` for topic named `counter-commands` and `OutgoingMessages` for `counter-events` from the TestKit.
Expand All @@ -251,9 +251,9 @@ TIP: In the example above we take advantage of the TestKit to serialize / deseri
Before running your test, make sure to configure the TestKit correctly.
[source, java]
.{sample-base-url}/event-sourced-counter-brokers/src/it/java/counter/application/CounterIntegrationTest.java[CounterIntegrationTest.java]
.{sample-base-url}/event-sourced-counter-brokers/src/test/java/counter/application/CounterIntegrationTest.java[CounterIntegrationTest.java]
----
include::example$event-sourced-counter-brokers/src/it/java/counter/application/CounterIntegrationTest.java[tags=eventing-config]
include::example$event-sourced-counter-brokers/src/test/java/counter/application/CounterIntegrationTest.java[tags=eventing-config]
----
<1> Mock incoming messages from the `counter-commands` topic.
<2> Mock outgoing messages from the `counter-events` topic.
Expand All @@ -263,9 +263,9 @@ include::example$event-sourced-counter-brokers/src/it/java/counter/application/C
Typically, messages are published with associated metadata. If you want to construct your own `Metadata` to be consumed by a service or make sure the messages published out of your service have specific metadata attached, you can do so using the TestKit, as shown below.
[source,java,indent=0]
.{sample-base-url}/event-sourced-counter-brokers/src/it/java/counter/application/CounterIntegrationTest.java[CounterIntegrationTest.java]
.{sample-base-url}/event-sourced-counter-brokers/src/test/java/counter/application/CounterIntegrationTest.java[CounterIntegrationTest.java]
----
include::example$event-sourced-counter-brokers/src/it/java/counter/application/CounterIntegrationTest.java[tags=test-topic-metadata]
include::example$event-sourced-counter-brokers/src/test/java/counter/application/CounterIntegrationTest.java[tags=test-topic-metadata]
----
<1> Build a `CloudEvent` object with the 3 required attributes, respectively: `id`, `source` and `type`.
<2> Add the subject to which the message is related, that is the `counterId`.
Expand All @@ -286,9 +286,9 @@ As an alternative, you can consider using different test suites which will use i
[source,java,indent=0]
.{sample-base-url}/event-sourced-counter-brokers/src/it/java/counter/application/CounterIntegrationTest.java[CounterIntegrationTest.java]
.{sample-base-url}/event-sourced-counter-brokers/src/test/java/counter/application/CounterIntegrationTest.java[CounterIntegrationTest.java]
----
include::example$event-sourced-counter-brokers/src/it/java/counter/application/CounterIntegrationTest.java[tags=clear-topics]
include::example$event-sourced-counter-brokers/src/test/java/counter/application/CounterIntegrationTest.java[tags=clear-topics]
----
<1> Run this before each test.
<2> Clear the topic ignoring any unread messages.
Expand All @@ -300,9 +300,9 @@ NOTE: Despite the example, you are neither forced to clear all topics nor to do
To run an integration test against a real instance of Google PubSub (or its Emulator) or Kafka, use the TestKit settings to override the default eventing support, as shown below:
[source,java]
.{sample-base-url}/event-sourced-counter-brokers/src/it/java/counter/application/CounterWithRealKafkaIntegrationTest.java[CounterWithRealKafkaIntegrationTest.java]
.{sample-base-url}/event-sourced-counter-brokers/src/test/java/counter/application/CounterWithRealKafkaIntegrationTest.java[CounterWithRealKafkaIntegrationTest.java]
----
include::example$event-sourced-counter-brokers/src/it/java/counter/application/CounterWithRealKafkaIntegrationTest.java[tags=kafka]
include::example$event-sourced-counter-brokers/src/test/java/counter/application/CounterWithRealKafkaIntegrationTest.java[tags=kafka]
----
== Multi-region replication
Expand Down
7 changes: 3 additions & 4 deletions docs/src/modules/java/pages/event-sourced-entities.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,9 @@ For the above example, this class provides access to all the command handlers of
The skeleton of an Integration Test is generated for you if you use the archetype to start your Akka service. Let's see what it could look like to test our `ShoppingCartEntity`:

[source,java]
.{sample-base-url}/shopping-cart-quickstart/src/it/java/shoppingcart/IntegrationTest.java[IntegrationTest.java]
.{sample-base-url}/shopping-cart-quickstart/src/test/java/shoppingcart/ShoppingCartIntegrationTest.java[ShoppingCartIntegrationTest.java]
----
include::example$shopping-cart-quickstart/src/it/java/shoppingcart/IntegrationTest.java[tag=sample-it]
include::example$shopping-cart-quickstart/src/test/java/shoppingcart/ShoppingCartIntegrationTest.java[tag=sample-it]
----
<1> Note the test class must extend `TestKitSupport`.
<2> A built-in component client is provided to interact with the components.
Expand All @@ -240,8 +240,7 @@ include::example$shopping-cart-quickstart/src/it/java/shoppingcart/IntegrationTe
<5> Request to retrieve current status of the shopping cart.
<6> Assert there should only be one item.

NOTE: The integration tests in samples are under a specific project profile `it` and can be run using `mvn verify -Pit`.

NOTE: The integration tests in samples can be run using `mvn integration-test`.
== Exposing entities directly

include::partial$component-endpoint.adoc[]
Expand Down
6 changes: 3 additions & 3 deletions docs/src/modules/java/pages/key-value-entities.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,17 @@ NOTE: The `KeyValueEntityTestKit` is stateful, and it holds the state of a singl
The skeleton of an Integration Test is generated for you if you use the archetype to start your Akka service. Let's see what it could look like to test our Counter Entity:

[source,java,indent=0]
.{sample-base-url}/key-value-counter/src/it/java/com/example/CounterIntegrationTest.java[CounterIntegrationTest.java]
.{sample-base-url}/key-value-counter/src/test/java/com/example/CounterIntegrationTest.java[CounterIntegrationTest.java]
----
include::example$key-value-counter/src/it/java/com/example/CounterIntegrationTest.java[tags=sample-it]
include::example$key-value-counter/src/test/java/com/example/CounterIntegrationTest.java[tags=sample-it]
----
<1> Note the test class must extend `TestKitSupport`.
<2> A built-in component client is provided to interact with the components.
<3> Get the current value of the counter named `bar`. Initial value of counter is expected to be `0`.
<4> Request to increase the value of counter `bar`. Response should have value `1`.
<5> Explicitly request current value of `bar`. It should be `1`.

NOTE: The integration tests in samples are under a specific project profile `it` and can be run using `mvn verify -Pit`.
NOTE: The integration tests in samples can be run using `mvn integration-test`.

== Exposing entities directly

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ The TestKit allows providing a custom `DependencyProvider` through `TestKit.Sett
that mock instances of dependencies can be used in tests.

[source,java]
.{sample-base-url}/doc-snippets/src/it/java/com/example/MyIntegrationTest.java[MyIntegrationTest.java]
.{sample-base-url}/doc-snippets/src/test/java/com/example/MyIntegrationTest.java[MyIntegrationTest.java]
----
include::example$doc-snippets/src/it/java/com/example/MyIntegrationTest.java[tag=test-di-provider]
include::example$doc-snippets/src/test/java/com/example/MyIntegrationTest.java[tag=test-di-provider]
----
<1> Implement a test specific `DependencyProvider`.
<2> Configure the TestKit to use it.
Expand Down
4 changes: 2 additions & 2 deletions docs/src/modules/java/pages/views.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,9 @@ include::example$key-value-customer-registry/src/main/java/customer/application/
An integration test can be implemented as below.
[source,java,indent=0]
.{sample-base-url}/key-value-customer-registry/src/it/java/customer/application/CustomersByCityIntegrationTest.java[CustomersByCityIntegrationTest.java]
.{sample-base-url}/key-value-customer-registry/src/test/java/customer/application/CustomersByCityIntegrationTest.java[CustomersByCityIntegrationTest.java]
----
include::example$key-value-customer-registry/src/it/java/customer/application/CustomersByCityIntegrationTest.java[tag=view-test]
include::example$key-value-customer-registry/src/test/java/customer/application/CustomersByCityIntegrationTest.java[tag=view-test]
----
<1> Mocks incoming messages from the `customer` Key Value Entity.
<2> Gets an `IncomingMessages` from the `customer` Key Value Entity.
Expand Down
13 changes: 13 additions & 0 deletions docs/src/modules/reference/pages/release-notes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@ Current versions
== December 2024

* Platform update 2024-12-10
- New internal structure to capture usage data
- Updated email server for signup emails
- Updated JVM memory settings for services
- Akka Runtime 1.2.5
- Better gRPC support for the CLI
- Console updates
** Empty projects can now be deleted from the Console
- GCP: Updates of GKE node versions

* Akka Runtime 1.2.5
- Improves handling of `count(*)` in the view query language

* Akka CLI 3.0.7
- Improvements to the Local Console

Expand Down
2 changes: 2 additions & 0 deletions docs/supplemental_ui/js/vendor/js.cookie.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5124cbb

Please sign in to comment.