Skip to content

Commit

Permalink
Added more classes to api.auth package, removed dep on slf4j-api from…
Browse files Browse the repository at this point in the history
… services-api
  • Loading branch information
artem-v committed Sep 28, 2024
1 parent 775ee5c commit bd541a1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,7 @@ private Mono<Object> authenticate(ServiceMessage message, Context context) {
if (context.hasKey(AUTH_CONTEXT_KEY)) {
return Mono.just(context.get(AUTH_CONTEXT_KEY));
} else {
throw new UnauthorizedException(
"Authentication failed (auth context not found and authenticator not set)");
throw new UnauthorizedException("Authentication failed");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import io.scalecube.services.api.ServiceMessage;
import io.scalecube.services.discovery.ScalecubeServiceDiscovery;
import io.scalecube.services.exceptions.ServiceException;
import io.scalecube.services.exceptions.ServiceUnavailableException;
import io.scalecube.services.registry.api.ServiceRegistry;
import io.scalecube.services.routing.RoundRobinServiceRouter;
import io.scalecube.services.sut.EmptyGreetingResponse;
Expand Down Expand Up @@ -183,8 +184,11 @@ public void test_async_greeting_return_string_service_not_found_error_case() {
Mono.from(service.requestOne(NOT_FOUND_REQ)).block(timeout);
fail("Expected no-service-found exception");
} catch (Exception ex) {
assertEquals(
ex.getMessage(), "No reachable member with such service: " + NOT_FOUND_REQ.qualifier());
assertEquals(ServiceUnavailableException.class, ex.getClass());
assertNotNull(ex.getMessage());
assertTrue(
ex.getMessage()
.startsWith("No reachable member with such service: " + NOT_FOUND_REQ.qualifier()));
}
}

Expand Down

0 comments on commit bd541a1

Please sign in to comment.