hanzhe-one opened a new pull request, #7970:
URL: https://github.com/apache/shenyu/pull/7970

   ## Problem
   
   `master` is red on `build (shenyu-integrated-test-http)` since #7903. 
`CryptorResponsePluginTest.testWhenDoesntExistFiled` asserts that a rule whose 
`fieldNames` matches nothing returns the original body, but #7903 deliberately 
changed that contract:
   
   ```java
   protected String fieldErrorParse(final String originalBody, final 
ServerWebExchange exchange) {
       ShenyuResultEnum resultEnum = checkErrorEnum();
       throw new ResponsiveException(resultEnum.getCode(), resultEnum.getMsg() 
+ "[fieldNames]", exchange);
   }
   ```
   
   The gateway now answers `{"code":-116,"message":"Please check Cryptor 
response plugin's [fieldNames]"}`, so the test's `postGateway(..., 
UserDTO.class)` deserializes to an object with a null `userId` and the 
assertion fails. #7903 validated only the cryptor module's unit tests, so the 
stale integrated test reached `master`.
   
   Evidence on the master push for `679a9eb69cb5fc61f1ae242c8f5bdd4011ead8f7`: 
[job 
119079963808](https://github.com/apache/shenyu/actions/runs/39554456101/job/119079963808).
 Reported as #7968.
   
   ## Change
   
   - Assert `CRYPTOR_RESPONSE_ERROR_CONFIGURATION.getCode()` and `.getMsg() + 
"[fieldNames]"` instead of the original body, mirroring how 
`CryptorRequestPluginTest` already asserts the request-side configuration error.
   - Rename `testWhenDoesntExistFiled` to `testWhenFieldDoesNotExistInResponse` 
and update its `@DisplayName`, which still described the passthrough behavior.
   
   Only the test changes; the plugin behavior introduced by #7903 is kept.
   
   ## Validation
   
   - `shenyu-integrated-test-http` compiles (`mvn -pl 
shenyu-integrated-test-http -am test-compile`).
   - Checkstyle passes for the module.
   - The integrated suite needs the Docker environment used by CI, so the run 
itself is left to the workflow.
   
   Fixes #7968
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to