@@ -41,9 +41,15 @@ describe('Microservices Service', () => {
4141
4242 def ( 'subject' , ( ) => $subject . listMicroservices ( flowId , user , isCLI , transaction ) ) ;
4343 def ( 'findMicroservicesResponse' , ( ) => Promise . resolve ( response ) ) ;
44+ def ( 'findPortMappingsResponse' , ( ) => Promise . resolve ( [ ] ) ) ;
45+ def ( 'findVolumeMappingsResponse' , ( ) => Promise . resolve ( [ ] ) ) ;
46+ def ( 'findRoutesResponse' , ( ) => Promise . resolve ( [ ] ) ) ;
4447
4548 beforeEach ( ( ) => {
4649 $sandbox . stub ( MicroserviceManager , 'findAllExcludeFields' ) . returns ( $findMicroservicesResponse ) ;
50+ $sandbox . stub ( MicroservicePortManager , 'findAll' ) . returns ( $findPortMappingsResponse ) ;
51+ $sandbox . stub ( VolumeMappingManager , 'findAll' ) . returns ( $findVolumeMappingsResponse ) ;
52+ $sandbox . stub ( RoutingManager , 'findAll' ) . returns ( $findRoutesResponse ) ;
4753 } ) ;
4854
4955 it ( 'calls MicroserviceManager#findAllExcludeFields() with correct args' , async ( ) => {
@@ -79,14 +85,22 @@ describe('Microservices Service', () => {
7985 const microserviceUuid = 'testMicroserviceUuid' ;
8086
8187 const response = {
82- uuid : 'testUuid'
88+ dataValues : {
89+ uuid : 'testUuid'
90+ }
8391 } ;
8492
8593 def ( 'subject' , ( ) => $subject . getMicroservice ( microserviceUuid , user , isCLI , transaction ) ) ;
8694 def ( 'findMicroserviceResponse' , ( ) => Promise . resolve ( response ) ) ;
95+ def ( 'findPortMappingsResponse' , ( ) => Promise . resolve ( [ ] ) ) ;
96+ def ( 'findVolumeMappingsResponse' , ( ) => Promise . resolve ( [ ] ) ) ;
97+ def ( 'findRoutesResponse' , ( ) => Promise . resolve ( [ ] ) ) ;
8798
8899 beforeEach ( ( ) => {
89100 $sandbox . stub ( MicroserviceManager , 'findOneExcludeFields' ) . returns ( $findMicroserviceResponse ) ;
101+ $sandbox . stub ( MicroservicePortManager , 'findAll' ) . returns ( $findPortMappingsResponse ) ;
102+ $sandbox . stub ( VolumeMappingManager , 'findAll' ) . returns ( $findVolumeMappingsResponse ) ;
103+ $sandbox . stub ( RoutingManager , 'findAll' ) . returns ( $findRoutesResponse ) ;
90104 } ) ;
91105
92106 it ( 'calls MicroserviceManager#findOneExcludeFields() with correct args' , async ( ) => {
0 commit comments