@@ -39,7 +39,14 @@ JobSchedulerService jobSchedulerService() {
3939 }
4040
4141 @ Test
42- void testHealthOk () {
42+ void testHealth (){
43+ HttpResponse <String > exchange = client .toBlocking ().exchange (HttpRequest .GET ("/health" ), String .class );
44+ Assertions .assertEquals (200 , exchange .code ());
45+ Assertions .assertEquals ("OK" , exchange .body ());
46+ }
47+
48+ @ Test
49+ void testStatusOk () {
4350 // mock Alma API, with response healthy
4451 EmbeddedServer almaApiMockServer = ApplicationContext .run (
4552 EmbeddedServer .class ,
@@ -52,14 +59,14 @@ void testHealthOk() {
5259 );
5360 // mock non empty joblist
5461 Mockito .when (jobSchedulerService .getScheduledJobs ()).thenReturn (Set .of (Mockito .mock (JobConfig .class )));
55- HttpResponse <String > exchange = client .toBlocking ().exchange (HttpRequest .GET ("/health " ), String .class );
62+ HttpResponse <String > exchange = client .toBlocking ().exchange (HttpRequest .GET ("/status " ), String .class );
5663 Assertions .assertEquals (200 , exchange .code ());
5764 Assertions .assertEquals ("OK" , exchange .body ());
5865 almaApiMockServer .close ();
5966 }
6067
6168 @ Test
62- void testHealthAlmaApiNotAvailable () {
69+ void testStatusAlmaApiNotAvailable () {
6370 // mock Alma API, with unsuccessful response
6471 EmbeddedServer almaApiMockServer = ApplicationContext .run (
6572 EmbeddedServer .class ,
@@ -73,7 +80,7 @@ void testHealthAlmaApiNotAvailable() {
7380 // mock non empty joblist
7481 Mockito .when (jobSchedulerService .getScheduledJobs ()).thenReturn (Set .of (Mockito .mock (JobConfig .class )));
7582 try {
76- client .toBlocking ().exchange (HttpRequest .GET ("/health " ), String .class );
83+ client .toBlocking ().exchange (HttpRequest .GET ("/status " ), String .class );
7784 } catch (HttpClientResponseException e ) {
7885 Assertions .assertEquals (500 , e .getResponse ().code ());
7986 Assertions .assertEquals ("Alma API not available" , e .getResponse ().body ());
@@ -82,7 +89,7 @@ void testHealthAlmaApiNotAvailable() {
8289 }
8390
8491 @ Test
85- void testHealthNoJobs () {
92+ void testStatusNoJobs () {
8693 // mock Alma API, with response healthy
8794 EmbeddedServer almaApiMockServer = ApplicationContext .run (
8895 EmbeddedServer .class ,
@@ -96,7 +103,7 @@ void testHealthNoJobs() {
96103 // mock empty joblist
97104 Mockito .when (jobSchedulerService .getScheduledJobs ()).thenReturn (Set .of ());
98105 try {
99- client .toBlocking ().exchange (HttpRequest .GET ("/health " ), String .class );
106+ client .toBlocking ().exchange (HttpRequest .GET ("/status " ), String .class );
100107 } catch (HttpClientResponseException e ) {
101108 Assertions .assertEquals (500 , e .getResponse ().code ());
102109 Assertions .assertEquals ("No jobs registered" , e .getResponse ().body ());
0 commit comments