Skip to content

Commit 3b95370

Browse files
committed
Restructure project for JitPack compatibility and add comprehensive integration tests
Major Changes: - Update groupId from com.tourino to io.github.wassertim for JitPack publishing - Migrate all package names to io.github.wassertim namespace - Update generated package strings in code generators (mappers, fields, infrastructure) - Update README.md with correct dependency coordinates Project Structure: - Main library: Clean single-module structure for JitPack - Integration tests: Separate Maven project in integration-tests/ directory - VS Code workspace: Multi-root configuration for better IDE support Integration Testing: - Add TestUser and TestProfile entities with @DynamoMappable annotations - Implement builder patterns required by generated mappers - Comprehensive test suite validating end-to-end annotation processing: * Bidirectional object conversion (domain ↔ DynamoDB AttributeValue) * Generated mapper dependency injection (TestUserMapper depends on TestProfileMapper) * Field constants generation and accessibility * TableNameResolver generation and functionality - All 5 integration tests passing, 10 main library tests passing Generated Artifacts Verified: - TestProfileMapper and TestUserMapper with CDI @ApplicationScoped annotations - TestUserFields and TestProfileFields with type-safe field name constants - TableNameResolver with proper table name mapping and error handling Benefits: - Clean JitPack publishing as io.github.wassertim:dynamodb-toolkit - Real integration testing using library as external dependency - Professional package naming aligned with GitHub organization - Proper separation of library vs testing concerns - Generated code verification through comprehensive test suite
1 parent bbb0d41 commit 3b95370

File tree

26 files changed

+623
-61
lines changed

26 files changed

+623
-61
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ Add the annotation processor to your Maven build:
100100

101101
```xml
102102
<dependency>
103-
<groupId>com.tourino</groupId>
104-
<artifactId>dynamodb-mapping-lib</artifactId>
103+
<groupId>io.github.wassertim</groupId>
104+
<artifactId>dynamodb-toolkit</artifactId>
105105
<version>1.0.0-SNAPSHOT</version>
106106
</dependency>
107107
```

dynamodb-toolkit.code-workspace

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"folders": [
3+
{
4+
"name": "DynamoDB Toolkit Library",
5+
"path": "."
6+
},
7+
{
8+
"name": "Integration Tests",
9+
"path": "./integration-tests"
10+
}
11+
],
12+
"settings": {
13+
"java.configuration.updateBuildConfiguration": "automatic",
14+
"java.compile.nullAnalysis.mode": "automatic",
15+
"java.import.maven.enabled": true,
16+
"java.configuration.maven.userSettings": null
17+
},
18+
"extensions": {
19+
"recommendations": [
20+
"vscjava.vscode-java-pack"
21+
]
22+
}
23+
}

integration-tests/pom.xml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
<?xml version="1.0"?>
2+
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
3+
xmlns="http://maven.apache.org/POM/4.0.0"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>io.github.wassertim</groupId>
8+
<artifactId>dynamodb-toolkit-integration-tests</artifactId>
9+
<version>1.0.0-SNAPSHOT</version>
10+
11+
<name>DynamoDB Toolkit Integration Tests</name>
12+
<description>Integration tests for DynamoDB Toolkit library with real entities and annotation processing</description>
13+
14+
<properties>
15+
<maven.compiler.source>21</maven.compiler.source>
16+
<maven.compiler.target>21</maven.compiler.target>
17+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
18+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
19+
20+
<!-- Dependency versions -->
21+
<aws.sdk.version>2.29.39</aws.sdk.version>
22+
<jakarta.enterprise.version>4.1.0</jakarta.enterprise.version>
23+
<junit.version>5.11.4</junit.version>
24+
<assertj.version>3.26.3</assertj.version>
25+
</properties>
26+
27+
<dependencies>
28+
<!-- Main library dependency -->
29+
<dependency>
30+
<groupId>io.github.wassertim</groupId>
31+
<artifactId>dynamodb-toolkit</artifactId>
32+
<version>1.0.0-SNAPSHOT</version>
33+
</dependency>
34+
35+
<!-- Core dependencies needed for test entities -->
36+
<dependency>
37+
<groupId>software.amazon.awssdk</groupId>
38+
<artifactId>dynamodb</artifactId>
39+
<version>${aws.sdk.version}</version>
40+
</dependency>
41+
42+
<!-- CDI for dependency injection -->
43+
<dependency>
44+
<groupId>jakarta.enterprise</groupId>
45+
<artifactId>jakarta.enterprise.cdi-api</artifactId>
46+
<version>${jakarta.enterprise.version}</version>
47+
</dependency>
48+
49+
<!-- Test dependencies -->
50+
<dependency>
51+
<groupId>org.junit.jupiter</groupId>
52+
<artifactId>junit-jupiter</artifactId>
53+
<version>${junit.version}</version>
54+
<scope>test</scope>
55+
</dependency>
56+
57+
<dependency>
58+
<groupId>org.assertj</groupId>
59+
<artifactId>assertj-core</artifactId>
60+
<version>${assertj.version}</version>
61+
<scope>test</scope>
62+
</dependency>
63+
</dependencies>
64+
65+
<build>
66+
<plugins>
67+
<plugin>
68+
<groupId>org.apache.maven.plugins</groupId>
69+
<artifactId>maven-compiler-plugin</artifactId>
70+
<version>3.14.0</version>
71+
<configuration>
72+
<source>${maven.compiler.source}</source>
73+
<target>${maven.compiler.target}</target>
74+
<encoding>${project.build.sourceEncoding}</encoding>
75+
<!-- Enable annotation processing for our test entities -->
76+
<annotationProcessorPaths>
77+
<path>
78+
<groupId>io.github.wassertim</groupId>
79+
<artifactId>dynamodb-toolkit</artifactId>
80+
<version>1.0.0-SNAPSHOT</version>
81+
</path>
82+
</annotationProcessorPaths>
83+
</configuration>
84+
</plugin>
85+
86+
<plugin>
87+
<groupId>org.apache.maven.plugins</groupId>
88+
<artifactId>maven-surefire-plugin</artifactId>
89+
<version>3.5.3</version>
90+
</plugin>
91+
</plugins>
92+
</build>
93+
94+
<!-- Profile for using JitPack version instead of local development -->
95+
<profiles>
96+
<profile>
97+
<id>jitpack</id>
98+
<dependencies>
99+
<dependency>
100+
<groupId>com.github.wassertim</groupId>
101+
<artifactId>dynamodb-toolkit</artifactId>
102+
<version>main-SNAPSHOT</version>
103+
<!-- Remove system scope when using JitPack -->
104+
</dependency>
105+
</dependencies>
106+
<repositories>
107+
<repository>
108+
<id>jitpack.io</id>
109+
<url>https://jitpack.io</url>
110+
</repository>
111+
</repositories>
112+
</profile>
113+
</profiles>
114+
</project>
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
package io.github.wassertim.dynamodb.toolkit.integration.entities;
2+
3+
import io.github.wassertim.dynamodb.toolkit.api.annotations.DynamoMappable;
4+
5+
/**
6+
* Nested entity to test complex object mapping and dependency resolution.
7+
* This class tests that the annotation processor correctly handles dependencies
8+
* between @DynamoMappable classes.
9+
*/
10+
@DynamoMappable
11+
public class TestProfile {
12+
13+
private String bio;
14+
private String location;
15+
private String website;
16+
private Integer followers;
17+
private Integer following;
18+
19+
// Default constructor
20+
public TestProfile() {}
21+
22+
// Builder constructor
23+
public TestProfile(String bio, String location, String website, Integer followers, Integer following) {
24+
this.bio = bio;
25+
this.location = location;
26+
this.website = website;
27+
this.followers = followers;
28+
this.following = following;
29+
}
30+
31+
// Getters and setters
32+
public String getBio() { return bio; }
33+
public void setBio(String bio) { this.bio = bio; }
34+
35+
public String getLocation() { return location; }
36+
public void setLocation(String location) { this.location = location; }
37+
38+
public String getWebsite() { return website; }
39+
public void setWebsite(String website) { this.website = website; }
40+
41+
public Integer getFollowers() { return followers; }
42+
public void setFollowers(Integer followers) { this.followers = followers; }
43+
44+
public Integer getFollowing() { return following; }
45+
public void setFollowing(Integer following) { this.following = following; }
46+
47+
// Builder pattern methods
48+
public static Builder builder() {
49+
return new Builder();
50+
}
51+
52+
public static class Builder {
53+
private String bio;
54+
private String location;
55+
private String website;
56+
private Integer followers;
57+
private Integer following;
58+
59+
public Builder bio(String bio) {
60+
this.bio = bio;
61+
return this;
62+
}
63+
64+
public Builder location(String location) {
65+
this.location = location;
66+
return this;
67+
}
68+
69+
public Builder website(String website) {
70+
this.website = website;
71+
return this;
72+
}
73+
74+
public Builder followers(Integer followers) {
75+
this.followers = followers;
76+
return this;
77+
}
78+
79+
public Builder following(Integer following) {
80+
this.following = following;
81+
return this;
82+
}
83+
84+
public TestProfile build() {
85+
return new TestProfile(bio, location, website, followers, following);
86+
}
87+
}
88+
89+
@Override
90+
public String toString() {
91+
return "TestProfile{" +
92+
"bio='" + bio + '\'' +
93+
", location='" + location + '\'' +
94+
", website='" + website + '\'' +
95+
", followers=" + followers +
96+
", following=" + following +
97+
'}';
98+
}
99+
}

0 commit comments

Comments
 (0)