Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for v1.6.3 #36

Merged
merged 11 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.1.4</version>
<version>3.3.1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>io.zenwave360.example</groupId>
Expand Down Expand Up @@ -47,6 +47,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-json</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
Expand Down Expand Up @@ -144,7 +148,7 @@
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>6.6.0</version>
<version>7.8.0</version>
<executions>
<execution>
<goals>
Expand All @@ -158,9 +162,7 @@
<modelPackage>io.zenwave360.example.adapters.web.model</modelPackage>
<modelNameSuffix>DTO</modelNameSuffix>
<addCompileSourceRoot>true</addCompileSourceRoot>
<supportingFilesToGenerate>
ApiUtil.java
</supportingFilesToGenerate>
<generateSupportingFiles>false</generateSupportingFiles>
<typeMappings>
<typeMapping>Double=java.math.BigDecimal</typeMapping>
</typeMappings>
Expand All @@ -171,7 +173,9 @@
<useOptional>true</useOptional>
<useTags>true</useTags>
<interfaceOnly>true</interfaceOnly>
<skipDefaultInterface>true</skipDefaultInterface>
<delegatePattern>false</delegatePattern>
<sortParamsByRequiredFlag>false</sortParamsByRequiredFlag>
</configOptions>
</configuration>
</execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.1.4</version>
<version>3.3.1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>io.zenwave360.example</groupId>
Expand Down Expand Up @@ -47,6 +47,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-json</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
Expand Down Expand Up @@ -140,7 +144,7 @@
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>6.6.0</version>
<version>7.8.0</version>
<executions>
<execution>
<goals>
Expand All @@ -154,9 +158,7 @@
<modelPackage>io.zenwave360.example.adapters.web.model</modelPackage>
<modelNameSuffix>DTO</modelNameSuffix>
<addCompileSourceRoot>true</addCompileSourceRoot>
<supportingFilesToGenerate>
ApiUtil.java
</supportingFilesToGenerate>
<generateSupportingFiles>false</generateSupportingFiles>
<typeMappings>
<typeMapping>Double=java.math.BigDecimal</typeMapping>
</typeMappings>
Expand All @@ -167,7 +169,9 @@
<useOptional>true</useOptional>
<useTags>true</useTags>
<interfaceOnly>true</interfaceOnly>
<skipDefaultInterface>true</skipDefaultInterface>
<delegatePattern>false</delegatePattern>
<sortParamsByRequiredFlag>false</sortParamsByRequiredFlag>
</configOptions>
</configuration>
</execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.1</version>
<version>3.3.1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<packaging>pom</packaging>
Expand Down Expand Up @@ -134,7 +134,7 @@
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>6.6.0</version>
<version>7.8.0</version>
<executions>
<execution>
<id>openapi-generator-server</id>
Expand All @@ -149,9 +149,7 @@
<modelPackage>${basePackage}.adapters.web.model</modelPackage>
<modelNameSuffix>DTO</modelNameSuffix>
<addCompileSourceRoot>true</addCompileSourceRoot>
<supportingFilesToGenerate>
ApiUtil.java
</supportingFilesToGenerate>
<generateSupportingFiles>false</generateSupportingFiles>
<typeMappings>
<typeMapping>Double=java.math.BigDecimal</typeMapping>
</typeMappings>
Expand All @@ -162,7 +160,9 @@
<useOptional>true</useOptional>
<useTags>true</useTags>
<interfaceOnly>true</interfaceOnly>
<skipDefaultInterface>true</skipDefaultInterface>
<delegatePattern>false</delegatePattern>
<sortParamsByRequiredFlag>false</sortParamsByRequiredFlag>
</configOptions>
</configuration>
</execution>
Expand All @@ -182,6 +182,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-json</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
Expand Down
14 changes: 9 additions & 5 deletions e2e/src/test/resources/projects/simple-domain-packaging/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.1.4</version>
<version>3.3.1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>io.zenwave360.example</groupId>
Expand Down Expand Up @@ -47,6 +47,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-json</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
Expand Down Expand Up @@ -140,7 +144,7 @@
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>6.6.0</version>
<version>7.8.0</version>
<executions>
<execution>
<goals>
Expand All @@ -154,9 +158,7 @@
<modelPackage>io.zenwave360.example.customer.dtos</modelPackage>
<modelNameSuffix>DTO</modelNameSuffix>
<addCompileSourceRoot>true</addCompileSourceRoot>
<supportingFilesToGenerate>
ApiUtil.java
</supportingFilesToGenerate>
<generateSupportingFiles>false</generateSupportingFiles>
<typeMappings>
<typeMapping>Double=java.math.BigDecimal</typeMapping>
</typeMappings>
Expand All @@ -167,7 +169,9 @@
<useOptional>true</useOptional>
<useTags>true</useTags>
<interfaceOnly>true</interfaceOnly>
<skipDefaultInterface>true</skipDefaultInterface>
<delegatePattern>false</delegatePattern>
<sortParamsByRequiredFlag>false</sortParamsByRequiredFlag>
</configOptions>
</configuration>
</execution>
Expand Down
2 changes: 2 additions & 0 deletions plugins/asyncapi-spring-cloud-streams3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ jbang zw -p io.zenwave360.sdk.plugins.SpringCloudStreams3Plugin --help
| `exposeMessage` | Whether to expose underlying spring Message to consumers or not. | boolean | false | |
| `apiPackage` | Java API package name for producerApiPackage and consumerApiPackage if not specified. | String | | |
| `modelPackage` | Java Models package name | String | | |
| `modelNamePrefix` | Sets the prefix for model classes and enums | String | | |
| `modelNameSuffix` | Sets the suffix for model classes and enums | String | | |
| `producerApiPackage` | Java API package name for outbound (producer) services. It can override apiPackage for producers. | String | {{apiPackage}} | |
| `consumerApiPackage` | Java API package name for inbound (consumer) services. It can override apiPackage for consumer. | String | {{apiPackage}} | |
| `bindingTypes` | Binding names to include in code generation. Generates code for ALL bindings if left empty | List | | |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE)
@SequenceGenerator(name = "sequenceGenerator")
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import static com.tngtech.archunit.library.Architectures.layeredArchitecture;
import static com.tngtech.archunit.library.Architectures.onionArchitecture;

@AnalyzeClasses(packages = "{{basePackage}}", importOptions = DoNotIncludeTests.class)
public class ArchitectureTest {
class ArchitectureTest {

/**
* Validates that dependencies between layers respect hexagonal/onion/clean architecture.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public class DockerComposeInitializer implements ApplicationContextInitializer<C
var serviceNames = services.stream().map(Service::name).toList();
return Stream.of("docker-compose", "docker-compose.exe").anyMatch(cmd -> {
try {
return getDockerComposeRunningServices(cmd, "-f", DOCKER_COMPOSE_FILE, "ps").containsAll(serviceNames);
return getDockerComposeRunningServices(cmd, "-f", DOCKER_COMPOSE_FILE, "ps", "--services").containsAll(serviceNames);
}
catch (IOException | InterruptedException e) {
return false;
Expand All @@ -104,16 +104,13 @@ public class DockerComposeInitializer implements ApplicationContextInitializer<C

String line;
while ((line = reader.readLine()) != null) {
if (!line.isEmpty()) {
String[] columns = line.split("\\s+");
if (columns.length > SERVICE_COLUMN) {
services.add(columns[SERVICE_COLUMN]);
}
}
if (!line.isEmpty()) {
services.add(line);
}
}

process.waitFor();
return services.size() > 1? services.subList(1, services.size()) : services;
return services;
}

boolean isPortOpen(String host, int port) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,32 +88,28 @@ public class DockerComposeInitializer implements ApplicationContextInitializer<C
var serviceNames = services.stream().map(Service::name).toList();
return Stream.of("docker-compose", "docker-compose.exe").anyMatch(cmd -> {
try {
return getDockerComposeRunningServices(cmd, "-f", DOCKER_COMPOSE_FILE, "ps").containsAll(serviceNames);
return getDockerComposeRunningServices(cmd, "-f", DOCKER_COMPOSE_FILE, "ps", "--services").containsAll(serviceNames);
}
catch (IOException | InterruptedException e) {
return false;
}
});
}

private static final int SERVICE_COLUMN = 3;
public List<String> getDockerComposeRunningServices(String... command) throws IOException, InterruptedException {
List<String> services = new ArrayList<>();
var process = new ProcessBuilder(command).start();
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));

String line;
while ((line = reader.readLine()) != null) {
if (!line.isEmpty()) {
String[] columns = line.split("\\s+");
if (columns.length > SERVICE_COLUMN) {
services.add(columns[SERVICE_COLUMN]);
}
}
if (!line.isEmpty()) {
services.add(line);
}
}

process.waitFor();
return services.size() > 1? services.subList(1, services.size()) : services;
return services;
}

boolean isPortOpen(String host, int port) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package {{basePackage}}.config;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.fasterxml.jackson.databind.ObjectMapper;
import jakarta.persistence.Table;

Expand All @@ -15,7 +16,10 @@ public class TestDataLoader {

private List<? extends Class<?>> jpaManagedTypes;

private ObjectMapper objectMapper = new ObjectMapper();
private final ObjectMapper objectMapper = new ObjectMapper();
{
objectMapper.registerModule(new JavaTimeModule());
}

public TestDataLoader(List<? extends Class<?>> jpaManagedTypes) {
this.jpaManagedTypes = jpaManagedTypes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import static org.mockito.Mockito.*;
/**
* Acceptance Test for {{service.name}}.
*/
public class {{service.name}}Test {
class {{service.name}}Test {

private final Logger log = LoggerFactory.getLogger(getClass());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import static org.mockito.Mockito.*;
/**
* Acceptance Test for {{service.name}}.
*/
public class {{service.name}}Test {
class {{service.name}}Test {

private final Logger log = LoggerFactory.getLogger(getClass());

Expand Down
Loading
Loading