File tree Expand file tree Collapse file tree
common/src/main/java/tools/simrail/backend/common/cache
external-api-client/src/test/java/tools/simrail/backend/external/playerdb
rest-api/src/main/java/tools/simrail/backend/api/user/loader Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ final class DataCacheMetricProcessor implements ApplicationListener<ApplicationR
4141 private final MeterRegistry meterRegistry ;
4242
4343 @ Autowired
44- public DataCacheMetricProcessor (@ NonNull MeterRegistry meterRegistry ) {
44+ DataCacheMetricProcessor (@ NonNull MeterRegistry meterRegistry ) {
4545 this .meterRegistry = meterRegistry ;
4646 }
4747
Original file line number Diff line number Diff line change @@ -83,9 +83,8 @@ void testInvalidSteamId() {
8383 void testInvalidXBoxId () {
8484 var client = PlayerDbApiClient .create (TEST_USER_AGENT );
8585 var response = Assertions .assertDoesNotThrow (() -> client .getXboxPlayer ("2535467890123456" ));
86- Assertions .assertEquals (PlayerDbResponseWrapper .RESPONSE_CODE_XBOX_BAD_RESPONSE_CODE , response .getCode ());
86+ Assertions .assertEquals (PlayerDbResponseWrapper .RESPONSE_CODE_XBOX_NOT_FOUND , response .getCode ());
8787 Assertions .assertNotNull (response .getData ());
8888 Assertions .assertNull (response .getData ().player ());
89- Assertions .assertEquals (400 , response .getData ().status ());
9089 }
9190}
Original file line number Diff line number Diff line change 2424
2525package tools .simrail .backend .api .user .loader ;
2626
27- import java .util .Objects ;
2827import java .util .Optional ;
2928import java .util .regex .Pattern ;
3029import org .jspecify .annotations .NonNull ;
3130import org .springframework .beans .factory .annotation .Autowired ;
32- import org .springframework .http .HttpStatus ;
3331import org .springframework .stereotype .Component ;
3432import org .springframework .util .StringUtils ;
3533import tools .simrail .backend .api .shared .UserPlatform ;
@@ -78,8 +76,7 @@ final class XBoxUserCacheLoader implements UserCacheLoader {
7876 var responseCode = response .getCode ();
7977 if (!responseCode .equals (PlayerDbResponseWrapper .RESPONSE_CODE_SUCCESS )) {
8078 // we already validated the id, so the only reason to get an "invalid id" response is that the user does not exist
81- var doesNotExist = responseCode .equals (PlayerDbResponseWrapper .RESPONSE_CODE_XBOX_BAD_RESPONSE_CODE )
82- && Objects .equals (response .getData ().status (), HttpStatus .BAD_REQUEST .value ());
79+ var doesNotExist = responseCode .equals (PlayerDbResponseWrapper .RESPONSE_CODE_XBOX_NOT_FOUND );
8380 if (doesNotExist ) {
8481 return Optional .empty ();
8582 }
You can’t perform that action at this time.
0 commit comments