### Question:
SnsMessageResource { @Action public Promise<ActionResponse, ResourceException> authenticate(Context context, ActionRequest actionRequest) { return handle(context, actionRequest); } @Inject  SnsMessageResource(CTSPersistentStore coreTokenService, PushNotificationService pushNotificationService,
                              JSONSerialisation jsonSerialisation, @Named("frPush") Debug debug,
                              JwtReconstruction jwtReconstruction); @Action Promise<ActionResponse, ResourceException> authenticate(Context context, ActionRequest actionRequest); @Action Promise<ActionResponse, ResourceException> register(Context context, ActionRequest actionRequest);  }### Answer:
@Test (expectedExceptions = BadRequestException.class) public void shouldFailWhenNoMessageId() throws ResourceException, InterruptedException { SSOTokenContext mockSSOTokenContext = mock(SSOTokenContext.class); RealmContext realmContext = new RealmContext(mockSSOTokenContext); realmContext.setSubRealm("realm", "realm"); JsonValue content = JsonValue.json(object(field("test", "test"))); ActionRequest request = mock(ActionRequest.class); given(request.getContent()).willReturn(content); given(request.getAction()).willReturn("authenticate"); Promise<ActionResponse, ResourceException> result = messageResource.authenticate(realmContext, request); result.getOrThrow(); }