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

Move history out of generator #2374

Merged
merged 1 commit into from
Jul 4, 2022
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

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package tech.jhipster.lite.generator.history.application;
package tech.jhipster.lite.history.application;

import java.util.List;
import org.springframework.stereotype.Service;
import tech.jhipster.lite.error.domain.Assert;
import tech.jhipster.lite.generator.history.domain.GeneratorHistoryRepository;
import tech.jhipster.lite.generator.history.domain.GeneratorHistoryValue;
import tech.jhipster.lite.generator.history.domain.HistoryProject;
import tech.jhipster.lite.history.domain.GeneratorHistoryRepository;
import tech.jhipster.lite.history.domain.GeneratorHistoryValue;
import tech.jhipster.lite.history.domain.HistoryProject;
import tech.jhipster.lite.module.domain.properties.JHipsterProjectFolder;

@Service
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tech.jhipster.lite.generator.history.domain;
package tech.jhipster.lite.history.domain;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tech.jhipster.lite.generator.history.domain;
package tech.jhipster.lite.history.domain;

import tech.jhipster.lite.module.domain.properties.JHipsterProjectFolder;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tech.jhipster.lite.generator.history.domain;
package tech.jhipster.lite.history.domain;

import java.time.Instant;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tech.jhipster.lite.generator.history.domain;
package tech.jhipster.lite.history.domain;

import tech.jhipster.lite.error.domain.Assert;
import tech.jhipster.lite.generator.project.domain.Project;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package tech.jhipster.lite.generator.history.infrastructure.primary;
package tech.jhipster.lite.history.infrastructure.primary;

import java.time.Clock;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.context.annotation.Configuration;
import tech.jhipster.lite.generator.history.application.GeneratorHistoryApplicationService;
import tech.jhipster.lite.generator.history.domain.GeneratorHistoryValue;
import tech.jhipster.lite.generator.history.domain.HistoryProject;
import tech.jhipster.lite.generator.project.domain.Project;
import tech.jhipster.lite.generator.project.infrastructure.primary.dto.ProjectDTO;
import tech.jhipster.lite.history.application.GeneratorHistoryApplicationService;
import tech.jhipster.lite.history.domain.GeneratorHistoryValue;
import tech.jhipster.lite.history.domain.HistoryProject;
import tech.jhipster.lite.technical.infrastructure.primary.annotation.GeneratorStep;

@Aspect
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tech.jhipster.lite.generator.history.infrastructure.primary;
package tech.jhipster.lite.history.infrastructure.primary;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
Expand All @@ -10,9 +10,9 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import tech.jhipster.lite.generator.history.application.GeneratorHistoryApplicationService;
import tech.jhipster.lite.generator.history.domain.GeneratorHistoryValue;
import tech.jhipster.lite.generator.history.infrastructure.primary.dto.HistoryDTO;
import tech.jhipster.lite.history.application.GeneratorHistoryApplicationService;
import tech.jhipster.lite.history.domain.GeneratorHistoryValue;
import tech.jhipster.lite.history.infrastructure.primary.dto.HistoryDTO;
import tech.jhipster.lite.module.domain.properties.JHipsterProjectFolder;

@RestController
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package tech.jhipster.lite.generator.history.infrastructure.primary;
package tech.jhipster.lite.history.infrastructure.primary;

import org.springframework.context.ApplicationListener;
import org.springframework.context.PayloadApplicationEvent;
import org.springframework.stereotype.Component;
import tech.jhipster.lite.generator.history.application.GeneratorHistoryApplicationService;
import tech.jhipster.lite.generator.history.domain.GeneratorHistoryValue;
import tech.jhipster.lite.generator.history.domain.HistoryProject;
import tech.jhipster.lite.history.application.GeneratorHistoryApplicationService;
import tech.jhipster.lite.history.domain.GeneratorHistoryValue;
import tech.jhipster.lite.history.domain.HistoryProject;
import tech.jhipster.lite.module.domain.JHipsterModuleApplied;

@Component
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package tech.jhipster.lite.generator.history.infrastructure.primary.dto;
package tech.jhipster.lite.history.infrastructure.primary.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import tech.jhipster.lite.generator.history.domain.GeneratorHistoryValue;
import tech.jhipster.lite.history.domain.GeneratorHistoryValue;

public record HistoryDTO(@Schema(name = "Service Ids applied to project", required = true) Collection<String> serviceIds) {
public static HistoryDTO from(List<GeneratorHistoryValue> serviceIds) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tech.jhipster.lite.generator.history.infrastructure.secondary;
package tech.jhipster.lite.history.infrastructure.secondary;

import com.fasterxml.jackson.core.JsonProcessingException;
import java.io.IOException;
Expand All @@ -8,14 +8,14 @@
import tech.jhipster.lite.common.domain.FileUtils;
import tech.jhipster.lite.common.domain.JsonUtils;
import tech.jhipster.lite.error.domain.GeneratorException;
import tech.jhipster.lite.generator.history.domain.GeneratorHistoryData;
import tech.jhipster.lite.generator.history.domain.GeneratorHistoryRepository;
import tech.jhipster.lite.generator.history.domain.GeneratorHistoryValue;
import tech.jhipster.lite.generator.history.domain.HistoryProject;
import tech.jhipster.lite.generator.history.infrastructure.secondary.dto.GeneratorHistoryDataDTO;
import tech.jhipster.lite.generator.history.infrastructure.secondary.dto.GeneratorHistoryValueDTO;
import tech.jhipster.lite.generator.project.domain.ProjectFile;
import tech.jhipster.lite.generator.project.domain.ProjectRepository;
import tech.jhipster.lite.history.domain.GeneratorHistoryData;
import tech.jhipster.lite.history.domain.GeneratorHistoryRepository;
import tech.jhipster.lite.history.domain.GeneratorHistoryValue;
import tech.jhipster.lite.history.domain.HistoryProject;
import tech.jhipster.lite.history.infrastructure.secondary.dto.GeneratorHistoryDataDTO;
import tech.jhipster.lite.history.infrastructure.secondary.dto.GeneratorHistoryValueDTO;
import tech.jhipster.lite.module.domain.properties.JHipsterProjectFolder;

@Repository
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tech.jhipster.lite.generator.history.infrastructure.secondary.dto;
package tech.jhipster.lite.history.infrastructure.secondary.dto;

import com.fasterxml.jackson.datatype.jsr310.deser.InstantDeserializer;
import java.time.Instant;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package tech.jhipster.lite.generator.history.infrastructure.secondary.dto;
package tech.jhipster.lite.history.infrastructure.secondary.dto;

import java.util.Collections;
import java.util.List;
import tech.jhipster.lite.generator.history.domain.GeneratorHistoryData;
import tech.jhipster.lite.generator.history.domain.GeneratorHistoryValue;
import tech.jhipster.lite.history.domain.GeneratorHistoryData;
import tech.jhipster.lite.history.domain.GeneratorHistoryValue;

public record GeneratorHistoryDataDTO(List<GeneratorHistoryValueDTO> values) {
public static GeneratorHistoryDataDTO from(List<GeneratorHistoryValue> values) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package tech.jhipster.lite.generator.history.infrastructure.secondary.dto;
package tech.jhipster.lite.history.infrastructure.secondary.dto;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.ser.InstantSerializer;
import java.time.Instant;
import tech.jhipster.lite.generator.history.domain.GeneratorHistoryValue;
import tech.jhipster.lite.history.domain.GeneratorHistoryValue;

public record GeneratorHistoryValueDTO(
String serviceId,
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/tech/jhipster/lite/history/package-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@tech.jhipster.lite.BusinessContext
package tech.jhipster.lite.history;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package tech.jhipster.lite.generator.history.application;
package tech.jhipster.lite.history.application;

import static org.assertj.core.api.Assertions.*;
import static tech.jhipster.lite.generator.history.domain.HistoryProjectsFixture.*;
import static tech.jhipster.lite.history.domain.HistoryProjectsFixture.*;

import java.io.IOException;
import java.nio.file.Files;
Expand All @@ -10,8 +10,8 @@
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import tech.jhipster.lite.IntegrationTest;
import tech.jhipster.lite.generator.history.domain.GeneratorHistoryValue;
import tech.jhipster.lite.generator.history.domain.HistoryProject;
import tech.jhipster.lite.history.domain.GeneratorHistoryValue;
import tech.jhipster.lite.history.domain.HistoryProject;

@IntegrationTest
class GeneratorHistoryApplicationServiceIT {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tech.jhipster.lite.generator.history.application;
package tech.jhipster.lite.history.application;

import static org.assertj.core.api.Assertions.*;
import static org.mockito.Mockito.*;
Expand All @@ -11,10 +11,10 @@
import org.mockito.junit.jupiter.MockitoExtension;
import tech.jhipster.lite.UnitTest;
import tech.jhipster.lite.error.domain.MissingMandatoryValueException;
import tech.jhipster.lite.generator.history.domain.GeneratorHistoryData;
import tech.jhipster.lite.generator.history.domain.GeneratorHistoryRepository;
import tech.jhipster.lite.generator.history.domain.HistoryProject;
import tech.jhipster.lite.generator.history.domain.HistoryProjectsFixture;
import tech.jhipster.lite.history.domain.GeneratorHistoryData;
import tech.jhipster.lite.history.domain.GeneratorHistoryRepository;
import tech.jhipster.lite.history.domain.HistoryProject;
import tech.jhipster.lite.history.domain.HistoryProjectsFixture;

@UnitTest
@ExtendWith(MockitoExtension.class)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tech.jhipster.lite.generator.history.domain;
package tech.jhipster.lite.history.domain;

import tech.jhipster.lite.common.domain.FileUtils;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tech.jhipster.lite.generator.history.infrastructure.primary;
package tech.jhipster.lite.history.infrastructure.primary;

import static org.assertj.core.api.Assertions.*;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tech.jhipster.lite.generator.history.infrastructure.primary;
package tech.jhipster.lite.history.infrastructure.primary;

import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package tech.jhipster.lite.generator.history.infrastructure.primary;
package tech.jhipster.lite.history.infrastructure.primary;

import static org.assertj.core.api.Assertions.*;
import static org.mockito.ArgumentMatchers.*;
import static org.mockito.Mockito.*;
import static tech.jhipster.lite.generator.history.infrastructure.primary.dto.HistoryDTOTest.*;
import static tech.jhipster.lite.history.infrastructure.primary.dto.HistoryDTOTest.*;

import java.util.List;
import org.junit.jupiter.api.Test;
Expand All @@ -14,9 +14,9 @@
import org.springframework.http.ResponseEntity;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import tech.jhipster.lite.UnitTest;
import tech.jhipster.lite.generator.history.application.GeneratorHistoryApplicationService;
import tech.jhipster.lite.generator.history.domain.GeneratorHistoryValue;
import tech.jhipster.lite.generator.history.infrastructure.primary.dto.HistoryDTO;
import tech.jhipster.lite.history.application.GeneratorHistoryApplicationService;
import tech.jhipster.lite.history.domain.GeneratorHistoryValue;
import tech.jhipster.lite.history.infrastructure.primary.dto.HistoryDTO;
import tech.jhipster.lite.module.domain.properties.JHipsterProjectFolder;

@UnitTest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package tech.jhipster.lite.generator.history.infrastructure.primary.dto;
package tech.jhipster.lite.history.infrastructure.primary.dto;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.*;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.json.JsonMapper;
import java.time.Instant;
import java.util.List;
import org.junit.jupiter.api.Test;
import tech.jhipster.lite.UnitTest;
import tech.jhipster.lite.generator.history.domain.GeneratorHistoryValue;
import tech.jhipster.lite.history.domain.GeneratorHistoryValue;

@UnitTest
public class HistoryDTOTest {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package tech.jhipster.lite.generator.history.infrastructure.secondary;
package tech.jhipster.lite.history.infrastructure.secondary;

import static org.assertj.core.api.Assertions.*;
import static org.mockito.ArgumentMatchers.*;
import static org.mockito.Mockito.*;
import static tech.jhipster.lite.generator.history.domain.HistoryProjectsFixture.*;
import static tech.jhipster.lite.history.domain.HistoryProjectsFixture.*;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
Expand All @@ -25,10 +25,10 @@
import tech.jhipster.lite.common.domain.FileUtils;
import tech.jhipster.lite.common.domain.JsonUtils;
import tech.jhipster.lite.error.domain.GeneratorException;
import tech.jhipster.lite.generator.history.domain.GeneratorHistoryData;
import tech.jhipster.lite.generator.history.domain.GeneratorHistoryValue;
import tech.jhipster.lite.generator.history.domain.HistoryProject;
import tech.jhipster.lite.generator.project.domain.ProjectRepository;
import tech.jhipster.lite.history.domain.GeneratorHistoryData;
import tech.jhipster.lite.history.domain.GeneratorHistoryValue;
import tech.jhipster.lite.history.domain.HistoryProject;

@UnitTest
@ExtendWith(MockitoExtension.class)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package tech.jhipster.lite.generator.history.infrastructure.secondary.dto;
package tech.jhipster.lite.history.infrastructure.secondary.dto;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.*;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package tech.jhipster.lite.generator.history.infrastructure.secondary.dto;
package tech.jhipster.lite.history.infrastructure.secondary.dto;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.*;

import java.time.Instant;
import java.util.List;
import org.junit.jupiter.api.Test;
import tech.jhipster.lite.UnitTest;
import tech.jhipster.lite.generator.history.domain.GeneratorHistoryValue;
import tech.jhipster.lite.history.domain.GeneratorHistoryValue;

@UnitTest
class GeneratorHistoryDataDTOTest {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package tech.jhipster.lite.generator.history.infrastructure.secondary.dto;
package tech.jhipster.lite.history.infrastructure.secondary.dto;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.*;

import java.time.Instant;
import org.junit.jupiter.api.Test;
import tech.jhipster.lite.UnitTest;
import tech.jhipster.lite.generator.history.domain.GeneratorHistoryValue;
import tech.jhipster.lite.history.domain.GeneratorHistoryValue;

@UnitTest
class GeneratorHistoryValueDTOTest {
Expand Down