Skip to content
Snippets Groups Projects
Commit 11f029df authored by OZGCloud's avatar OZGCloud
Browse files

Merge branch 'master' into OZG-4561-alfa-renames

parents 559016b5 13f43eae
Branches
Tags
No related merge requests found
......@@ -6,7 +6,7 @@ import org.springframework.context.annotation.Configuration;
import lombok.Getter;
@Configuration
public class AlfaSpringProperties {
public class AlfaProperties {
@Getter
@Value("${spring.application.name}")
......
......@@ -15,7 +15,7 @@ import de.itvsh.ozg.pluto.statistic.GrpcVorgangStatisticQuery.Operator;
import de.itvsh.ozg.pluto.statistic.GrpcVorgangStatisticRequest;
import de.itvsh.ozg.pluto.statistic.GrpcVorgangStatisticResponse;
import de.itvsh.ozg.pluto.statistic.StatisticServiceGrpc.StatisticServiceBlockingStub;
import de.ozgcloud.alfa.AlfaSpringProperties;
import de.ozgcloud.alfa.AlfaProperties;
import de.ozgcloud.alfa.common.GrpcUtil;
import de.ozgcloud.alfa.vorgang.Vorgang.VorgangStatus;
import net.devh.boot.grpc.client.inject.GrpcClient;
......@@ -37,7 +37,7 @@ class StatisticRemoteService {
@Autowired
private StatisticMapper mapper;
@Autowired
private AlfaSpringProperties alfaSpringProperties;
private AlfaProperties alfaProperties;
public Map<String, StatisticResult> getVorgaengeStatistics(List<VorgangStatus> countByVorgangStatus) {
var grpcRequest = GrpcVorgangStatisticRequest.newBuilder()
......@@ -67,7 +67,7 @@ class StatisticRemoteService {
GrpcVorgangStatisticQuery buildExistsWiedervorlageOverdueQuery() {
return GrpcVorgangStatisticQuery.newBuilder()
.setResultName(EXISTS_WIEDERVORLAGE_OVERDUE_RESULT_NAME)
.setPath(String.format(WIEDERVORLAGE_NEXT_FRIST_PATH_TEMPLATE, alfaSpringProperties.getApplicationName()))
.setPath(String.format(WIEDERVORLAGE_NEXT_FRIST_PATH_TEMPLATE, alfaProperties.getApplicationName()))
.setGroupMethod(GroupMethod.EXISTS)
.setOperator(Operator.LESS_THEN_OR_EQUAL_TO)
.setOperandStringValue(OPERAND_TODAY_DATE)
......
......@@ -8,7 +8,7 @@ import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import de.ozgcloud.alfa.AlfaSpringProperties;
import de.ozgcloud.alfa.AlfaProperties;
import de.ozgcloud.alfa.common.user.CurrentUserService;
import de.ozgcloud.alfa.common.user.UserRole;
import de.ozgcloud.alfa.vorgang.Vorgang.VorgangStatus;
......@@ -33,7 +33,7 @@ class StatisticService {
private CurrentUserService currentUserService;
@Autowired
private AlfaSpringProperties alfaSpringProperties;
private AlfaProperties alfaProperties;
public Statistic getVorgaengeStatistic() {
var response = remoteService.getVorgaengeStatistics(List.of(VorgangStatus.ZU_LOESCHEN));
......@@ -85,7 +85,7 @@ class StatisticService {
}
List<String> createCountByPathList() {
return List.of(String.format(COUNT_WIEDERVORLAGE_NEXT_FRIST_TEMPLATE, alfaSpringProperties.getApplicationName()));
return List.of(String.format(COUNT_WIEDERVORLAGE_NEXT_FRIST_TEMPLATE, alfaProperties.getApplicationName()));
}
Statistic buildStatistic(CountVorgangResponse response) {
......
......@@ -27,7 +27,7 @@ import de.itvsh.ozg.pluto.statistic.GrpcVorgangStatisticQuery.Operator;
import de.itvsh.ozg.pluto.statistic.GrpcVorgangStatisticResponse;
import de.itvsh.ozg.pluto.statistic.GrpcVorgangStatisticResult;
import de.itvsh.ozg.pluto.statistic.StatisticServiceGrpc.StatisticServiceBlockingStub;
import de.ozgcloud.alfa.AlfaSpringProperties;
import de.ozgcloud.alfa.AlfaProperties;
import de.ozgcloud.alfa.vorgang.Vorgang.VorgangStatus;
class StatisticRemoteServiceTest {
......@@ -40,7 +40,7 @@ class StatisticRemoteServiceTest {
@Mock
private StatisticMapper mapper;
@Mock
private AlfaSpringProperties alfaSpringProperties;
private AlfaProperties alfaProperties;
private static final List<VorgangStatus> STATUSES_TO_COUNT = List.of(VorgangStatus.NEU, VorgangStatus.ANGENOMMEN,
VorgangStatus.IN_BEARBEITUNG, VorgangStatus.BESCHIEDEN,
......@@ -110,7 +110,7 @@ class StatisticRemoteServiceTest {
@BeforeEach
void init() {
when(alfaSpringProperties.getApplicationName()).thenReturn(applicationName);
when(alfaProperties.getApplicationName()).thenReturn(applicationName);
}
@Test
......@@ -152,7 +152,7 @@ class StatisticRemoteServiceTest {
void shouldCallPropertiesToGetClientName() {
service.buildExistsWiedervorlageOverdueQuery();
verify(alfaSpringProperties).getApplicationName();
verify(alfaProperties).getApplicationName();
}
}
......
......@@ -21,7 +21,7 @@ import org.mockito.Spy;
import com.thedeanda.lorem.LoremIpsum;
import de.ozgcloud.alfa.AlfaSpringProperties;
import de.ozgcloud.alfa.AlfaProperties;
import de.ozgcloud.alfa.common.user.CurrentUserService;
import de.ozgcloud.alfa.common.user.UserRole;
import de.ozgcloud.alfa.vorgang.Vorgang.VorgangStatus;
......@@ -36,7 +36,7 @@ class StatisticServiceTest {
@Mock
private CurrentUserService currentUserService;
@Mock
private AlfaSpringProperties alfaSpringProperties;
private AlfaProperties alfaProperties;
@Nested
class TestBuildGetVorgaengeStatisticResult {
......@@ -241,7 +241,7 @@ class StatisticServiceTest {
@Test
void shouldCallRemoteService() {
when(alfaSpringProperties.getApplicationName()).thenReturn(applicationName);
when(alfaProperties.getApplicationName()).thenReturn(applicationName);
when(remoteService.countVorgang(any())).thenReturn(response);
service.countVorgang();
......@@ -251,7 +251,7 @@ class StatisticServiceTest {
@Test
void shouldBuildStatistic() {
when(alfaSpringProperties.getApplicationName()).thenReturn(applicationName);
when(alfaProperties.getApplicationName()).thenReturn(applicationName);
when(remoteService.countVorgang(any())).thenReturn(response);
service.countVorgang();
......
......@@ -22,8 +22,6 @@ spring:
mvc:
pathmatch:
matching-strategy: ant-path-matcher
application:
name: Alfa
jackson:
deserialization:
'ADJUST_DATES_TO_CONTEXT_TIME_ZONE': false
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment