Skip to content

Commit

Permalink
#138 🎨, 💡 handle todos
Browse files Browse the repository at this point in the history
  • Loading branch information
vjohnslhm committed Nov 12, 2024
1 parent 2ee94e8 commit 71d03eb
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

@Slf4j
@Component
@Profile(Profiles.DUMMY_CLIENTS) // todo: das profil dürfte hier eigentlich nicht manuell hinzugefügt werden
@Profile(Profiles.DUMMY_CLIENTS)
public class DummyClientImpl implements WahlvorstandEaiClient, WahlenClient, KonfigurierterWahltagClient {
@Override
public WahlvorstandModel getWahlvorstand(String wahlbezirkID, LocalDate wahltag) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ public interface WahlvorstandClientMapper {

ZoneId ZONE_ID = ZoneId.systemDefault();

@Mapping(target = "anwesenheitBeginn", ignore = true) // todo: darf das ignoriert werden?
@Mapping(target = "anwesenheitBeginn", ignore = true)
@Mapping(target = "wahlvorstandsmitglieder", source = "mitglieder")
WahlvorstandModel toModel(WahlvorstandDTO wahlvorstandDTO);

@Mapping(target = "familienname", source = "nachname")
@Mapping(target = "funktionsname", ignore = true) // todo: darf das ignoriert werden?
@Mapping(target = "funktionsname", ignore = true)
WahlvorstandsmitgliedModel toModel(WahlvorstandsmitgliedDTO wahlvorstandsmitgliedDTO);

@Mapping(target = "mitglieder", source = "wahlvorstandsmitglieder")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ public class WahlvorstandController {
)
@GetMapping("/{wahlbezirkID}")
public ResponseEntity<WahlvorstandDTO> getWahlvorstand(
@RequestHeader(value = "forceupdate", required = false) String forceUpdate,
@RequestHeader(value = "forceupdate", required = false) Boolean forceUpdate,
@PathVariable("wahlbezirkID") String wahlbezirkID) {

Optional<WahlvorstandModel> result;

if (forceUpdate != null && forceUpdate.equals("true")) {
if (Boolean.TRUE.equals(forceUpdate)) {
result = wahlvorstandService.updateWahlvorstand(wahlbezirkID);
} else {
result = wahlvorstandService.getWahlvorstand(wahlbezirkID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class GetWahlvorstand {
@Test
void should_returnWahlvorstandDTO_when_givenValidWahlbezirkIdAndForceUpdateIsFalse() {
val wahlbezirkID = "wahlbezirkID";
val forceUpdate = "false";
val forceUpdate = false;
val mockedWahlvorstandModel = TestDataFactory.CreateWahlvorstandModel.withData();
val expectedWahlvorstandDto = TestDataFactory.CreateWahlvorstandDto.fromModel(mockedWahlvorstandModel);

Expand All @@ -47,7 +47,7 @@ void should_returnWahlvorstandDTO_when_givenValidWahlbezirkIdAndForceUpdateIsFal
@Test
void should_returnWahlvorstandDTO_when_givenValidWahlbezirkIdAndForceUpdateIsTrue() {
val wahlbezirkID = "wahlbezirkID";
val forceUpdate = "true";
val forceUpdate = true;
val mockedWahlvorstandModel = TestDataFactory.CreateWahlvorstandModel.withData();
val expectedWahlvorstandDto = TestDataFactory.CreateWahlvorstandDto.fromModel(mockedWahlvorstandModel);

Expand All @@ -62,7 +62,7 @@ void should_returnWahlvorstandDTO_when_givenValidWahlbezirkIdAndForceUpdateIsTru
@Test
void should_returnFallbackWahlvorstandDTO_when_WahlvorstandDoesNotExist() {
val wahlbezirkID = "wahlbezirkID";
val forceUpdate = "false";
val forceUpdate = false;
val mockedFallbackWahlvorstandModel = TestDataFactory.CreateWahlvorstandModel.fallback(wahlbezirkID);
val expectedWahlvorstandDto = TestDataFactory.CreateWahlvorstandDto.fromModel(mockedFallbackWahlvorstandModel);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ username = wls_all_uwb
GET {{ SSO_URL }}/auth/realms/wls_realm/protocol/openid-connect/userinfo
Authorization: {{ token_type }} {{ auth_token }}

### GET wahlvorstand - working with dummy.client
GET {{ WLS_WAHLVORSTAND_SERVICE_URL }}/businessActions/wahlvorstand/wahlbezirkID
### GET wahlvorstand fallback - working with dummy.client
GET {{ WLS_WAHLVORSTAND_SERVICE_URL }}/businessActions/wahlvorstand/wahlbezirkID1
Authorization: {{ token_type }} {{ auth_token }}

### POST wahlvorstand
Expand Down Expand Up @@ -63,3 +63,7 @@ Content-Type: application/json
}
]
}

### GET wahlvorstand - working with dummy.client
GET {{ WLS_WAHLVORSTAND_SERVICE_URL }}/businessActions/wahlvorstand/wahlbezirkID
Authorization: {{ token_type }} {{ auth_token }}

0 comments on commit 71d03eb

Please sign in to comment.