ServletRegistrationComponent implements RestServicesMBean { public void stopping() throws Exception { if( this.filterServiceRegistration != null ) this.filterServiceRegistration.unregister(); this.logger.fine( "iPojo unregisters REST and icons servlets related to Roboconf's DM." ); if( this.httpService != null ) { this.httpService.unregister( REST_CONTEXT ); this.httpService.unregister( ICONS_CONTEXT ); this.httpService.unregister( WEBSOCKET_CONTEXT ); } else { this.logger.fine( "The HTTP service is gone. The servlets were already unregistered." ); } this.app = null; this.jerseyServlet = null; this.filterServiceRegistration = null; this.authenticationFilter = null; } ServletRegistrationComponent( BundleContext bundleContext ); void starting(); void stopping(); void schedulerAppears(); void schedulerDisappears(); void mavenResolverAppears(); void mavenResolverDisappears(); void setHttpService( HttpService httpService ); void setManager( Manager manager ); void setEnableCors( boolean enableCors ); void setEnableAuthentication( boolean enableAuthentication ); void setAuthenticationRealm( String authenticationRealm ); void setSessionPeriod( long sessionPeriod ); void setScheduler( IScheduler scheduler ); void setMavenResolver( MavenResolver mavenResolver ); @Override int getCurrentWebSocketClientsCount(); @Override long getWebSocketConnectionErrorsCount(); @Override long getRestRequestsWithAuthFailureCount(); @Override long getRestRequestsCount(); @Override boolean isAuthenticationRequired(); @Override boolean isCorsEnabled(); @Override void reset(); static final String REST_CONTEXT; static final String WEBSOCKET_CONTEXT; final AtomicLong restRequestsCount; final AtomicLong restRequestsWithAuthFailureCount; static final AtomicLong WS_CONNECTION_ERRORS_COUNT; }
@Test public void testStop_httpServiceIsNull() throws Exception { this.register.stopping(); Mockito.verifyZeroInteractions( this.bundleContext ); }