test_class.declarator: testee = new ExceptionAdvice()
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private ExceptionAdvice testee = new ExceptionAdvice();
test_class.type: ExceptionAdvice
test_class.var_name: testee
test_class.file: spring-ddd/spring-ddd-bank/src/test/java/de/beuth/knabe/spring_ddd_bank/rest_interface/ExceptionAdviceTest.java
test_class.identifier: ExceptionAdviceTest
test_case.body: @Test
  	public void exceptionToStatus() {
  		// Specific business rule violations:
  		_assertStatus(HttpStatus.NOT_FOUND, new BankService.ClientNotFoundExc());
  		_assertStatus(HttpStatus.NOT_FOUND, new Client.NotManagedAccountExc());
  		_assertStatus(HttpStatus.FORBIDDEN, new Client.NotOwnerExc());
  		_assertStatus(HttpStatus.FORBIDDEN, new Client.WithoutRightExc());
  
  		// General business rule violations:
  		_assertStatus(HttpStatus.BAD_REQUEST, new Amount.RangeExc());
  		_assertStatus(HttpStatus.BAD_REQUEST, new BankService.DeleteExc());
  		_assertStatus(HttpStatus.BAD_REQUEST, new BankService.UsernameExc());
  		_assertStatus(HttpStatus.BAD_REQUEST, new Client.AmountExc());
  		_assertStatus(HttpStatus.BAD_REQUEST, new Client.DoubleManagerExc());
  		_assertStatus(HttpStatus.BAD_REQUEST, new Client.MinimumBalanceExc());
  
  		// Rule violations in the rest-interface layer:
  		_assertStatus(HttpStatus.BAD_REQUEST, new ClientCreateWithIdExc());
  
  		// other errors:
  		_assertStatus(HttpStatus.INTERNAL_SERVER_ERROR, new IllegalAccessException());
  	}
test_case.class_method_signature: ExceptionAdviceTest.exceptionToStatus()
test_case.full_signature: @Test public void exceptionToStatus()
test_case.identifier: exceptionToStatus
test_case.invocations: _assertStatus _assertStatus _assertStatus _assertStatus _assertStatus _assertStatus _assertStatus _assertStatus _assertStatus _assertStatus _assertStatus _assertStatus
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void exceptionToStatus()
focal_class.declarator: BASE_NAME = "MessageText"
focal_class.modifier: public static final
focal_class.original_string: public static final String BASE_NAME = "MessageText";
focal_class.type: String
focal_class.var_name: BASE_NAME
focal_class.declarator: log = LoggerFactory.getLogger(ExceptionAdvice.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(ExceptionAdvice.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: restInterfacePackagePrefix = _computePackagePrefix(ApplicationController.ClientCreateWithIdExc.class)
focal_class.modifier: final
focal_class.original_string: final String restInterfacePackagePrefix = _computePackagePrefix(ApplicationController.ClientCreateWithIdExc.class);
focal_class.type: String
focal_class.var_name: restInterfacePackagePrefix
focal_class.declarator: domainPackagePrefix = _computePackagePrefix(Client.NotOwnerExc.class)
focal_class.modifier: final
focal_class.original_string: final String domainPackagePrefix = _computePackagePrefix(Client.NotOwnerExc.class);
focal_class.type: String
focal_class.var_name: domainPackagePrefix
focal_class.file: spring-ddd/spring-ddd-bank/src/main/java/de/beuth/knabe/spring_ddd_bank/rest_interface/ExceptionAdvice.java
focal_class.identifier: ExceptionAdvice
focal_class.class_method_signature: ExceptionAdvice.reportException(final Exception ex, final Locale requestLocale, final HttpServletResponse response)
focal_class.full_signature: @ResponseBody @ExceptionHandler({ Exception.class }) VndErrors reportException(final Exception ex, final Locale requestLocale, final HttpServletResponse response)
focal_class.identifier: reportException
focal_class.modifiers: @ResponseBody @ExceptionHandler({ Exception.class })
focal_class.parameters: (final Exception ex, final Locale requestLocale, final HttpServletResponse response)
focal_class.return: VndErrors
focal_class.signature: VndErrors reportException(final Exception ex, final Locale requestLocale, final HttpServletResponse response)
focal_class.class_method_signature: ExceptionAdvice.exceptionToStatus(final Exception exc)
focal_class.full_signature:  HttpStatus exceptionToStatus(final Exception exc)
focal_class.identifier: exceptionToStatus
focal_class.parameters: (final Exception exc)
focal_class.return: HttpStatus
focal_class.signature: HttpStatus exceptionToStatus(final Exception exc)
focal_class.class_method_signature: ExceptionAdvice._computePackagePrefix(final Class<?> excClass)
focal_class.full_signature:  String _computePackagePrefix(final Class<?> excClass)
focal_class.identifier: _computePackagePrefix
focal_class.parameters: (final Class<?> excClass)
focal_class.return: String
focal_class.signature: String _computePackagePrefix(final Class<?> excClass)
focal_method.body: HttpStatus exceptionToStatus(final Exception exc) {
  		if (exc instanceof BankService.ClientNotFoundExc) {
  			return HttpStatus.NOT_FOUND;
  		}
  		if (exc instanceof Client.NotManagedAccountExc) {
  			return HttpStatus.NOT_FOUND;
  		}
  		if (exc instanceof Client.NotOwnerExc) {
  			return HttpStatus.FORBIDDEN;
  		}
  		if (exc instanceof Client.WithoutRightExc) {
  			return HttpStatus.FORBIDDEN;
  		}
  		final String excClassName = exc.getClass().getName();
  		if (excClassName.startsWith(restInterfacePackagePrefix) || excClassName.startsWith(domainPackagePrefix)) {
  			return HttpStatus.BAD_REQUEST;
  		}
  		return HttpStatus.INTERNAL_SERVER_ERROR;
  	}
focal_method.class_method_signature: ExceptionAdvice.exceptionToStatus(final Exception exc)
focal_method.full_signature:  HttpStatus exceptionToStatus(final Exception exc)
focal_method.identifier: exceptionToStatus
focal_method.invocations: getName getClass startsWith startsWith
focal_method.parameters: (final Exception exc)
focal_method.return: HttpStatus
focal_method.signature: HttpStatus exceptionToStatus(final Exception exc)