@@ -109,19 +109,6 @@ describe("AzureController", () => {
109109 expect ( result ) . toEqual ( { id : "1" } ) ;
110110 expect ( classifierService . createClassifierModel ) . toHaveBeenCalled ( ) ;
111111 } ) ;
112- it ( "should throw ForbiddenException if user not in group" , async ( ) => {
113- const req = createMockReq ( ) ;
114- const body = {
115- name : "c1" ,
116- description : "desc" ,
117- source : ClassifierSource . AZURE ,
118- status : ClassifierStatus . READY ,
119- group_id : "g1" ,
120- } ;
121- await expect ( controller . createClassifier ( req , body ) ) . rejects . toThrow (
122- ForbiddenException ,
123- ) ;
124- } ) ;
125112 it ( "should throw ForbiddenException if classifier exists" , async ( ) => {
126113 classifierService . findClassifierModel . mockResolvedValue ( { id : "1" } ) ;
127114 const req = createMockReq ( "user1" , [ "g1" ] ) ;
@@ -173,17 +160,6 @@ describe("AzureController", () => {
173160 expect . any ( Buffer ) ,
174161 ) ;
175162 } ) ;
176- it ( "should throw ForbiddenException if user not in group" , async ( ) => {
177- const req = createMockReq ( ) ;
178- await expect (
179- controller . uploadClassifierDocuments (
180- req ,
181- [ ] ,
182- { name : "c1" , label : "l1" } ,
183- "g1" ,
184- ) ,
185- ) . rejects . toThrow ( ForbiddenException ) ;
186- } ) ;
187163 it ( "should throw NotFoundException if classifier does not exist" , async ( ) => {
188164 classifierService . findClassifierModel . mockResolvedValue ( null ) ;
189165 const req = createMockReq ( "user1" , [ "g1" ] ) ;
@@ -210,15 +186,6 @@ describe("AzureController", () => {
210186 "classifier/g1/c1/" ,
211187 ) ;
212188 } ) ;
213- it ( "should throw ForbiddenException if user not in group" , async ( ) => {
214- const req = createMockReq ( ) ;
215- await expect (
216- controller . deleteClassifierDocuments ( req , {
217- name : "c1" ,
218- group_id : "g1" ,
219- } ) ,
220- ) . rejects . toThrow ( ForbiddenException ) ;
221- } ) ;
222189 it ( "should throw NotFoundException if classifier does not exist" , async ( ) => {
223190 classifierService . findClassifierModel . mockResolvedValue ( null ) ;
224191 const req = createMockReq ( "user1" , [ "g1" ] ) ;
@@ -306,12 +273,6 @@ describe("AzureController", () => {
306273 ) ;
307274 expect ( result ) . toEqual ( { result : "ok" } ) ;
308275 } ) ;
309- it ( "should throw ForbiddenException if user not in group" , async ( ) => {
310- const req = createMockReq ( ) ;
311- await expect (
312- controller . requestClassification ( req , { name : "c1" } , mockFile , "g1" ) ,
313- ) . rejects . toThrow ( ForbiddenException ) ;
314- } ) ;
315276 it ( "should throw NotFoundException if classifier does not exist" , async ( ) => {
316277 classifierService . findClassifierModel . mockResolvedValue ( null ) ;
317278 const req = createMockReq ( "user1" , [ "g1" ] ) ;
@@ -373,15 +334,6 @@ describe("AzureController", () => {
373334 } ) ,
374335 ) . rejects . toThrow ( ) ;
375336 } ) ;
376- it ( "should throw ForbiddenException if user not in group" , async ( ) => {
377- const req = createMockReq ( ) ;
378- await expect (
379- controller . getTrainingResult ( req , {
380- name : "c1" ,
381- group_id : "g1" ,
382- } ) ,
383- ) . rejects . toThrow ( ForbiddenException ) ;
384- } ) ;
385337 it ( "should throw NotFoundException if classifier not found" , async ( ) => {
386338 classifierService . findClassifierModel . mockResolvedValue ( null ) ;
387339 const req = createMockReq ( "user1" , [ "g1" ] ) ;
@@ -436,12 +388,6 @@ describe("AzureController", () => {
436388 controller . getTrainingResult ( req , { name : null , group_id : null } ) ,
437389 ) . rejects . toThrow ( ) ;
438390 } ) ;
439- it ( "should throw ForbiddenException if user not in group" , async ( ) => {
440- const req = createMockReq ( ) ;
441- await expect (
442- controller . getTrainingResult ( req , { name : "c1" , group_id : "g1" } ) ,
443- ) . rejects . toThrow ( ForbiddenException ) ;
444- } ) ;
445391 it ( "should throw NotFoundException if classifier not found" , async ( ) => {
446392 classifierService . findClassifierModel . mockResolvedValue ( null ) ;
447393 const req = createMockReq ( "user1" , [ "g1" ] ) ;
@@ -514,13 +460,6 @@ describe("AzureController", () => {
514460 expect ( result ) . toEqual ( [ "labelA/doc1" , "labelB/doc2" ] ) ;
515461 expect ( storageService . list ) . toHaveBeenCalledWith ( "classifier/g1/c1/" ) ;
516462 } ) ;
517- it ( "should throw ForbiddenException if user not in group" , async ( ) => {
518- const req = createMockReq ( ) ;
519- const query = { name : "c1" , group_id : "g1" } ;
520- await expect (
521- controller . getClassifierDocuments ( req , query ) ,
522- ) . rejects . toThrow ( ForbiddenException ) ;
523- } ) ;
524463 it ( "should throw NotFoundException if classifier does not exist" , async ( ) => {
525464 classifierService . findClassifierModel . mockResolvedValue ( null ) ;
526465 const req = createMockReq ( "user1" , [ "g1" ] ) ;
@@ -548,13 +487,6 @@ describe("AzureController", () => {
548487 "user1" ,
549488 ) ;
550489 } ) ;
551- it ( "should throw ForbiddenException if user not in group" , async ( ) => {
552- const req = createMockReq ( ) ;
553- const body = { name : "c1" , group_id : "g1" , description : "desc" } ;
554- await expect ( controller . updateClassifier ( req , body ) ) . rejects . toThrow (
555- ForbiddenException ,
556- ) ;
557- } ) ;
558490 it ( "should throw NotFoundException if classifier does not exist" , async ( ) => {
559491 classifierService . findClassifierModel . mockResolvedValue ( null ) ;
560492 const req = createMockReq ( "user1" , [ "g1" ] ) ;
0 commit comments