/** * Construct an exception with the provided message and cause. * * @param message the exception message * @param cause the cause of the exception */ public ServiceBrokerInvalidOriginatingIdentityException(String message, Throwable cause) { super(prependMessagePrefix(message), cause); }
throw new ServiceBrokerInvalidOriginatingIdentityException("Expected platform and properties values in " + ServiceBrokerRequest.ORIGINATING_IDENTITY_HEADER + " header in request"); encodedProperties = new String(Base64Utils.decode(parts[1].getBytes())); } catch (IllegalArgumentException e) { throw new ServiceBrokerInvalidOriginatingIdentityException("Error decoding JSON properties from " + ServiceBrokerRequest.ORIGINATING_IDENTITY_HEADER + " header in request", e); properties = readJsonFromString(encodedProperties); } catch (IOException e) { throw new ServiceBrokerInvalidOriginatingIdentityException("Error parsing JSON properties from " + ServiceBrokerRequest.ORIGINATING_IDENTITY_HEADER + " header in request", e);
throw new ServiceBrokerInvalidOriginatingIdentityException("Expected platform and properties values in " + ServiceBrokerRequest.ORIGINATING_IDENTITY_HEADER + " header in request"); encodedProperties = new String(Base64Utils.decode(parts[1].getBytes())); } catch (IllegalArgumentException e) { throw new ServiceBrokerInvalidOriginatingIdentityException("Error decoding JSON properties from " + ServiceBrokerRequest.ORIGINATING_IDENTITY_HEADER + " header in request", e); properties = readJsonFromString(encodedProperties); } catch (IOException e) { throw new ServiceBrokerInvalidOriginatingIdentityException("Error parsing JSON properties from " + ServiceBrokerRequest.ORIGINATING_IDENTITY_HEADER + " header in request", e);
@Test public void serviceBrokerInvalidOriginatingIdentityException() { ServiceBrokerInvalidOriginatingIdentityException exception = new ServiceBrokerInvalidOriginatingIdentityException("test message"); ErrorMessage errorMessage = exceptionHandler.handleException(exception); assertThat(errorMessage.getError()).isNull(); assertThat(errorMessage.getMessage()).contains("test message"); }
/** * Construct an exception with the provided message. * * @param message the exception message */ public ServiceBrokerInvalidOriginatingIdentityException(String message) { super(prependMessagePrefix(message)); }
/** * Construct an exception with the provided message and cause. * * @param message the exception message * @param cause the cause of the exception */ public ServiceBrokerInvalidOriginatingIdentityException(String message, Throwable cause) { super(prependMessagePrefix(message), cause); }
/** * Construct an exception with the provided message. * * @param message the exception message */ public ServiceBrokerInvalidOriginatingIdentityException(String message) { super(prependMessagePrefix(message)); }