Class
caplin.services.testing

PermissionServiceFixture

The PermissionServiceFixture serves to provide a way for tests to interact with the PermissioningService providing trading and view allow or deny permissions on tiles and instruments

Use of the Fixture assumes that a caplin.trading.testing.PermissioningServiceStub is registered as a service on the caplin.core.ServiceRegistry under the namespace "caplin.services.security.PermissionService".

Tests may use the PermissionServiceFixture to:

  • deny 1 click spot trading on /FX/GBPUSD
    when("permissions.deny => ['/FX/GBPUSD', 'TradeProtocol', 'ESP']")
    and("permissions.deny => ['/FX/GBPUSD', 'TradeType', 'SPOT']")
    ...
  • allow view permissions on /FX/GBPUSD
    when("permissions.allow => ['/FX/GBPUSD', null, 'VIEW']")
    ...

Constructor Summary

Attributes Name and Description
caplin.services.testing.PermissionServiceFixture()

Constructs a caplin.services.testing.PermissionServiceFixture.

Method Summary

Attributes Name and Description
void canHandleProperty( sProperty)

PermissionServiceFixture handles properties 'allow' and 'deny',

void doGiven(String sPropertyName, Variant vValue)

This method is used to inform listeners on the PermissioningService about the permissions change on tile or instruments.

Methods implemented from class caplin.testing.Fixture:
addSubFixtures, doThen, doWhen, setUp, tearDown

Constructor Detail

caplin.services.testing.PermissionServiceFixture()

Constructs a caplin.services.testing.PermissionServiceFixture.

Method Detail

void canHandleProperty( sProperty)

PermissionServiceFixture handles properties 'allow' and 'deny',

Parameters
sProperty
See
caplin.testing.Fixture#canHandleProperty

void doGiven(String sPropertyName, Variant vValue)

This method is used to inform listeners on the PermissioningService about the permissions change on tile or instruments.

Parameters
String sPropertyName The property name
Variant vValue The value to check
See
caplin.testing.Fixture#doGiven