git » notification-sender.git » commit b6bdf18

project initialization

author Thorsten Ortlepp
2024-04-23 19:15:19 UTC
committer Thorsten Ortlepp
2024-04-23 19:15:19 UTC

project initialization

.gitignore +38 -0
pom.xml +54 -0
src/main/java/eu/ortlepp/notificationsender/NotificationHandler.java +12 -0
src/test/java/eu/ortlepp/notificationsender/NotificationHandlerTest.java +16 -0

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..5ff6309
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,38 @@
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### IntelliJ IDEA ###
+.idea/modules.xml
+.idea/jarRepositories.xml
+.idea/compiler.xml
+.idea/libraries/
+*.iws
+*.iml
+*.ipr
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..ad5af5f
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>eu.ortlepp</groupId>
+  <artifactId>notification-sender</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <properties>
+    <maven.compiler.source>21</maven.compiler.source>
+    <maven.compiler.target>21</maven.compiler.target>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>com.amazonaws</groupId>
+      <artifactId>aws-lambda-java-core</artifactId>
+      <version>1.2.3</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter</artifactId>
+      <version>5.10.2</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <finalName>${project.artifactId}</finalName>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-shade-plugin</artifactId>
+        <version>3.5.2</version>
+        <configuration>
+          <createDependencyReducedPom>false</createDependencyReducedPom>
+        </configuration>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>
\ No newline at end of file
diff --git a/src/main/java/eu/ortlepp/notificationsender/NotificationHandler.java b/src/main/java/eu/ortlepp/notificationsender/NotificationHandler.java
new file mode 100644
index 0000000..43e1aa9
--- /dev/null
+++ b/src/main/java/eu/ortlepp/notificationsender/NotificationHandler.java
@@ -0,0 +1,12 @@
+package eu.ortlepp.notificationsender;
+
+import com.amazonaws.services.lambda.runtime.Context;
+import com.amazonaws.services.lambda.runtime.RequestHandler;
+
+public class NotificationHandler implements RequestHandler<String, String> {
+
+  public String handleRequest(String event, Context context) {
+    return event.toLowerCase();
+  }
+
+}
\ No newline at end of file
diff --git a/src/test/java/eu/ortlepp/notificationsender/NotificationHandlerTest.java b/src/test/java/eu/ortlepp/notificationsender/NotificationHandlerTest.java
new file mode 100644
index 0000000..efe768f
--- /dev/null
+++ b/src/test/java/eu/ortlepp/notificationsender/NotificationHandlerTest.java
@@ -0,0 +1,16 @@
+package eu.ortlepp.notificationsender;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import org.junit.jupiter.api.Test;
+
+public class NotificationHandlerTest {
+
+  @Test
+  void testHandleRequest() {
+    String value = "Test";
+    NotificationHandler handler = new NotificationHandler();
+    assertEquals(value.toLowerCase(), handler.handleRequest(value, null));
+  }
+
+}