diff --git a/spring-boot-modules/spring-boot-hexagonal/README.md b/spring-boot-modules/spring-boot-hexagonal/README.md deleted file mode 100644 index 44728b185e..0000000000 --- a/spring-boot-modules/spring-boot-hexagonal/README.md +++ /dev/null @@ -1,4 +0,0 @@ -## HEXAGONAL Architecture - -This module contains articles about Hexagonal Architecture implemented via Spring Boot. - diff --git a/spring-boot-modules/spring-boot-hexagonal/pom.xml b/spring-boot-modules/spring-boot-hexagonal/pom.xml deleted file mode 100644 index c4ff36c2cf..0000000000 --- a/spring-boot-modules/spring-boot-hexagonal/pom.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - 4.0.0 - spring-boot-hexagonal - spring-boot-hexagonal - - - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 - - - - - org.springframework.boot - spring-boot-starter-web - - - - org.springframework.boot - spring-boot-starter-test - - - - - - spring-boot-hexagonal - - - src/main/resources - true - - - - - org.springframework.boot - spring-boot-maven-plugin - - exec - - - - - - - UTF-8 - - - diff --git a/spring-boot-modules/spring-boot-hexagonal/src/main/java/com/baeldung/Application.java b/spring-boot-modules/spring-boot-hexagonal/src/main/java/com/baeldung/Application.java deleted file mode 100644 index 37dbe7dab8..0000000000 --- a/spring-boot-modules/spring-boot-hexagonal/src/main/java/com/baeldung/Application.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.baeldung; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class Application { - - public static void main(String[] args) { - SpringApplication.run(Application.class, args); - } - -} diff --git a/spring-boot-modules/spring-boot-hexagonal/src/main/java/com/baeldung/adapter/DocumentRepositoryImpl.java b/spring-boot-modules/spring-boot-hexagonal/src/main/java/com/baeldung/adapter/DocumentRepositoryImpl.java deleted file mode 100644 index 32414442ef..0000000000 --- a/spring-boot-modules/spring-boot-hexagonal/src/main/java/com/baeldung/adapter/DocumentRepositoryImpl.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.baeldung.adapter; - -import org.springframework.stereotype.Repository; - -import com.baeldung.domain.Document; -import com.baeldung.domain.port.DocumentRepo; - -import java.util.HashMap; -import java.util.Map; - -@Repository -public class DocumentRepositoryImpl implements DocumentRepo { - - private Map documentMap = new HashMap<>(); - - @Override - public void storeDocument(Document document) { - documentMap.put(document.getId(), document); - } - - @Override - public Document findDocumentById(String id) { - return documentMap.get(id); - } -} diff --git a/spring-boot-modules/spring-boot-hexagonal/src/main/java/com/baeldung/adapter/DocumentRestAdapter.java b/spring-boot-modules/spring-boot-hexagonal/src/main/java/com/baeldung/adapter/DocumentRestAdapter.java deleted file mode 100644 index 985a5257c0..0000000000 --- a/spring-boot-modules/spring-boot-hexagonal/src/main/java/com/baeldung/adapter/DocumentRestAdapter.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.baeldung.adapter; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import com.baeldung.domain.Document; -import com.baeldung.domain.port.DocumentService; - -@RestController -@RequestMapping("/doc") -public class DocumentRestAdapter { - @Autowired - private DocumentService documentService; - - @PostMapping - public void createDocument(@RequestBody Document document) { - documentService.createDocument(document); - } - - @GetMapping("/{id}") - public Document findById(@PathVariable String id) { - return documentService.findById(id); - } - -} diff --git a/spring-boot-modules/spring-boot-hexagonal/src/main/java/com/baeldung/domain/Document.java b/spring-boot-modules/spring-boot-hexagonal/src/main/java/com/baeldung/domain/Document.java deleted file mode 100644 index 24d0a95071..0000000000 --- a/spring-boot-modules/spring-boot-hexagonal/src/main/java/com/baeldung/domain/Document.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.baeldung.domain; - -public class Document { - private String id; - private String data; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getData() { - return data; - } - - public void setData(String data) { - this.data = data; - } - -} diff --git a/spring-boot-modules/spring-boot-hexagonal/src/main/java/com/baeldung/domain/port/DocumentRepo.java b/spring-boot-modules/spring-boot-hexagonal/src/main/java/com/baeldung/domain/port/DocumentRepo.java deleted file mode 100644 index 001e3251e4..0000000000 --- a/spring-boot-modules/spring-boot-hexagonal/src/main/java/com/baeldung/domain/port/DocumentRepo.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.baeldung.domain.port; - -import com.baeldung.domain.Document; - -public interface DocumentRepo { - void storeDocument(Document document); - - Document findDocumentById(String id); -} diff --git a/spring-boot-modules/spring-boot-hexagonal/src/main/java/com/baeldung/domain/port/DocumentService.java b/spring-boot-modules/spring-boot-hexagonal/src/main/java/com/baeldung/domain/port/DocumentService.java deleted file mode 100644 index 009c26c01f..0000000000 --- a/spring-boot-modules/spring-boot-hexagonal/src/main/java/com/baeldung/domain/port/DocumentService.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.baeldung.domain.port; - -import com.baeldung.domain.Document; - -public interface DocumentService { - - void createDocument(Document document); - - Document findById(String id); - -} diff --git a/spring-boot-modules/spring-boot-hexagonal/src/main/java/com/baeldung/domain/port/impl/DocumentServiceImpl.java b/spring-boot-modules/spring-boot-hexagonal/src/main/java/com/baeldung/domain/port/impl/DocumentServiceImpl.java deleted file mode 100644 index f5c351406e..0000000000 --- a/spring-boot-modules/spring-boot-hexagonal/src/main/java/com/baeldung/domain/port/impl/DocumentServiceImpl.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.baeldung.domain.port.impl; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import com.baeldung.domain.Document; -import com.baeldung.domain.port.DocumentRepo; -import com.baeldung.domain.port.DocumentService; - -@Service -public class DocumentServiceImpl implements DocumentService { - - @Autowired - private DocumentRepo documentRepo; - - @Override - public void createDocument(Document document) { - documentRepo.storeDocument(document); - } - - @Override - public Document findById(String id) { - return documentRepo.findDocumentById(id); - } -} diff --git a/spring-boot-modules/spring-boot-hexagonal/src/main/resources/application.properties b/spring-boot-modules/spring-boot-hexagonal/src/main/resources/application.properties deleted file mode 100644 index 8b13789179..0000000000 --- a/spring-boot-modules/spring-boot-hexagonal/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ - diff --git a/spring-boot-modules/spring-boot-hexagonal/src/test/java/com/baeldung/ApplicationUnitTest.java b/spring-boot-modules/spring-boot-hexagonal/src/test/java/com/baeldung/ApplicationUnitTest.java deleted file mode 100644 index 2ce9b1cf24..0000000000 --- a/spring-boot-modules/spring-boot-hexagonal/src/test/java/com/baeldung/ApplicationUnitTest.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.baeldung; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@SpringBootTest -@RunWith(SpringRunner.class) -class ApplicationUnitTest { - - @Test - public void contextLoads() { - } - -}