Skip to content

Commit bc82785

Browse files
authored
Publish Release 0.3.0
Automerge Pull-Request for Release 0.3.0
2 parents bc6927c + 019b08b commit bc82785

File tree

5 files changed

+50
-3
lines changed

5 files changed

+50
-3
lines changed

ReleaseNotes.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,24 @@
22

33
# Release Notes ZETA Testfachdienst
44

5+
## Release 0.3.0
6+
7+
TestFachdienst 0.3.0
8+
9+
This release starts the release notes for TestFachdienst beginning with version 0.3.0.
10+
It includes targeted API behavior updates and model validation adjustments.
11+
12+
#### Release Focus:
13+
14+
- Added `GET /zeta-v1/hello-zeta/proxy-error` endpoint to return a proxy-specific error response.
15+
- Added `ZETA-Cause: Proxy` response header with `HTTP 400 Bad Request` for the proxy error endpoint.
16+
- Added controller test coverage for the new proxy error response behavior.
17+
- Removed `@PastOrPresent` and `@FutureOrPresent` annotations from `Erezept` date fields.
18+
19+
### Known issues:
20+
21+
- None documented for this release.
22+
523
## Release 0.2.1
624

725
### added:

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ plugins {
1515
}
1616

1717
group = "de.gematik.zeta"
18-
version = "0.1.3"
18+
version = "0.3.0"
1919
description =
2020
"achelos Testfachdienst providing a REST API with CRUD operations, secure communication via TLS and Websocket connections."
2121

src/main/java/de/gematik/zeta/testfachdienst/controller/HelloZetaController.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import de.gematik.zeta.testfachdienst.model.HelloZetaResource;
2828
import de.gematik.zeta.testfachdienst.service.HelloZetaService;
2929
import lombok.extern.slf4j.Slf4j;
30+
import org.springframework.http.HttpStatus;
3031
import org.springframework.http.ResponseEntity;
3132
import org.springframework.web.bind.annotation.GetMapping;
3233
import org.springframework.web.bind.annotation.RequestMapping;
@@ -67,4 +68,18 @@ public ResponseEntity<HelloZetaResource> getHelloZetaResponse() {
6768
log.debug("Got resource: '" + resource + "' from service, returning resource with 200.");
6869
return ResponseEntity.ok(resource);
6970
}
71+
72+
/**
73+
* Return a response that signals a proxy error to the caller.
74+
*
75+
* @return HTTP 400 response with ZETA-Cause header set to Proxy
76+
*/
77+
@GetMapping("/proxy-error")
78+
public ResponseEntity<HelloZetaResource> getHelloZetaProxyErrorResponse() {
79+
log.debug("Returning proxy error response for HelloZeta.");
80+
HelloZetaResource resource = service.getHelloZetaResource();
81+
return ResponseEntity.status(HttpStatus.BAD_REQUEST)
82+
.header("ZETA-Cause", "Proxy")
83+
.body(resource);
84+
}
7085
}

src/main/java/de/gematik/zeta/testfachdienst/model/Erezept.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,11 @@ public class Erezept {
7272
@Schema(description = "Dosage instructions", example = "1 tablet, 3× daily after meals")
7373
private String dosage;
7474

75-
@PastOrPresent
7675
@Column(nullable = false)
7776
@Schema(description = "When it was issued (ISO-8601)", example = "2025-09-22T10:30:00Z",
7877
format = "date-time")
7978
private OffsetDateTime issuedAt;
8079

81-
@FutureOrPresent
8280
@Schema(description = "When it expires (ISO-8601)", example = "2025-12-31T23:59:59Z",
8381
format = "date-time")
8482
private OffsetDateTime expiresAt;

src/test/java/de/gematik/zeta/testfachdienst/controller/HelloZetaControllerTest.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,20 @@ void getHelloZetaResponse_returnsServicePayload() {
6262
assertThat(response.getStatusCode().value()).isEqualTo(200);
6363
verify(service).getHelloZetaResource();
6464
}
65+
66+
/**
67+
* Verifies that the proxy error endpoint sets the ZETA-Cause header.
68+
*/
69+
@Test
70+
void getHelloZetaProxyErrorResponse_setsProxyHeader() {
71+
var resource = new HelloZetaResource("Hello");
72+
when(service.getHelloZetaResource()).thenReturn(resource);
73+
74+
var response = controller.getHelloZetaProxyErrorResponse();
75+
76+
assertThat(response.getBody()).isSameAs(resource);
77+
assertThat(response.getStatusCode().value()).isEqualTo(400);
78+
assertThat(response.getHeaders().getFirst("ZETA-Cause")).isEqualTo("Proxy");
79+
verify(service).getHelloZetaResource();
80+
}
6581
}

0 commit comments

Comments
 (0)