@Test
public void testExceptionWhenBundleIsNotAllowed() throws FunctionalException {

    final FunctionalException fe = new FunctionalException(FunctionalExceptionType.UNAUTHORIZED,
            ComponentType.WS_SMART_METERING);
    doThrow(fe).when(this.domainHelperService).checkAllowed(this.organisation, this.device,
            DeviceFunction.HANDLE_BUNDLED_ACTIONS);
    // Run the test
    try {
        this.bundleService.enqueueBundleRequest(ORGANISATION_IDENTIFICATION, DEVICE_IDENTIFICATION,
                this.actionRequestMockList, MESSAGE_PRIORITY, BYPASS_RETRY);
    } catch (final FunctionalException e) {
        // Verify the test
        assertThat(e).isEqualTo(fe);
    }
}