@@ -124,9 +124,9 @@ class InternControllerTest extends UnitSuite with TestEnvironment with TapirCont
124
124
125
125
test(" That DELETE /index removes all indexes" ) {
126
126
when(imageIndexService.findAllIndexes(any[String ])).thenReturn(Success (List (" index1" , " index2" , " index3" )))
127
- doReturn(Success (" " ), Nil * ).when(imageIndexService).deleteIndexWithName(Some (" index1" ))
128
- doReturn(Success (" " ), Nil * ).when(imageIndexService).deleteIndexWithName(Some (" index2" ))
129
- doReturn(Success (" " ), Nil * ).when(imageIndexService).deleteIndexWithName(Some (" index3" ))
127
+ doReturn(Success (" " ), Nil * ).when(imageIndexService).deleteIndexWithName(Some (" index1" ))
128
+ doReturn(Success (" " ), Nil * ).when(imageIndexService).deleteIndexWithName(Some (" index2" ))
129
+ doReturn(Success (" " ), Nil * ).when(imageIndexService).deleteIndexWithName(Some (" index3" ))
130
130
val res = simpleHttpClient
131
131
.send(quickRequest.delete(uri " http://localhost: $serverPort/intern/index " ))
132
132
res.code.code should be(200 )
@@ -139,12 +139,12 @@ class InternControllerTest extends UnitSuite with TestEnvironment with TapirCont
139
139
}
140
140
141
141
test(" That DELETE /index fails if at least one index isn't found, and no indexes are deleted" ) {
142
- doReturn(Failure (new RuntimeException (" Failed to find indexes" )), Nil * )
142
+ doReturn(Failure (new RuntimeException (" Failed to find indexes" )), Nil * )
143
143
.when(imageIndexService)
144
144
.findAllIndexes(props.SearchIndex )
145
- doReturn(Success (" " ), Nil * ).when(imageIndexService).deleteIndexWithName(Some (" index1" ))
146
- doReturn(Success (" " ), Nil * ).when(imageIndexService).deleteIndexWithName(Some (" index2" ))
147
- doReturn(Success (" " ), Nil * ).when(imageIndexService).deleteIndexWithName(Some (" index3" ))
145
+ doReturn(Success (" " ), Nil * ).when(imageIndexService).deleteIndexWithName(Some (" index1" ))
146
+ doReturn(Success (" " ), Nil * ).when(imageIndexService).deleteIndexWithName(Some (" index2" ))
147
+ doReturn(Success (" " ), Nil * ).when(imageIndexService).deleteIndexWithName(Some (" index3" ))
148
148
val res = simpleHttpClient
149
149
.send(quickRequest.delete(uri " http://localhost: $serverPort/intern/index " ))
150
150
res.code.code should equal(500 )
@@ -156,11 +156,11 @@ class InternControllerTest extends UnitSuite with TestEnvironment with TapirCont
156
156
" That DELETE /index fails if at least one index couldn't be deleted, but the other indexes are deleted regardless"
157
157
) {
158
158
when(imageIndexService.findAllIndexes(any[String ])).thenReturn(Success (List (" index1" , " index2" , " index3" )))
159
- doReturn(Success (" " ), Nil * ).when(imageIndexService).deleteIndexWithName(Some (" index1" ))
160
- doReturn(Failure (new RuntimeException (" No index with name 'index2' exists" )), Nil * )
159
+ doReturn(Success (" " ), Nil * ).when(imageIndexService).deleteIndexWithName(Some (" index1" ))
160
+ doReturn(Failure (new RuntimeException (" No index with name 'index2' exists" )), Nil * )
161
161
.when(imageIndexService)
162
162
.deleteIndexWithName(Some (" index2" ))
163
- doReturn(Success (" " ), Nil * ).when(imageIndexService).deleteIndexWithName(Some (" index3" ))
163
+ doReturn(Success (" " ), Nil * ).when(imageIndexService).deleteIndexWithName(Some (" index3" ))
164
164
val res = simpleHttpClient
165
165
.send(quickRequest.delete(uri " http://localhost: $serverPort/intern/index " ))
166
166
res.code.code should equal(500 )
0 commit comments