Search in sources :

Example 6 with AthenzClientFactoryMock

use of com.yahoo.vespa.hosted.controller.athenz.mock.AthenzClientFactoryMock in project vespa by vespa-engine.

the class ApplicationApiTest method createAthenzDomainWithAdmin.

/**
 * In production this happens outside hosted Vespa, so there is no API for it and we need to reach down into the
 * mock setup to replicate the action.
 */
private void createAthenzDomainWithAdmin(AthenzDomain domain, UserId userId) {
    AthenzClientFactoryMock mock = (AthenzClientFactoryMock) container.components().getComponent(AthenzClientFactoryMock.class.getName());
    AthenzDbMock.Domain domainMock = new AthenzDbMock.Domain(domain);
    domainMock.markAsVespaTenant();
    domainMock.admin(AthenzUser.fromUserId(userId.id()));
    mock.getSetup().addDomain(domainMock);
}
Also used : AthenzClientFactoryMock(com.yahoo.vespa.hosted.controller.athenz.mock.AthenzClientFactoryMock) AthenzDbMock(com.yahoo.vespa.hosted.controller.athenz.mock.AthenzDbMock) AthenzDomain(com.yahoo.vespa.athenz.api.AthenzDomain)

Aggregations

AthenzClientFactoryMock (com.yahoo.vespa.hosted.controller.athenz.mock.AthenzClientFactoryMock)6 AthenzDbMock (com.yahoo.vespa.hosted.controller.athenz.mock.AthenzDbMock)3 AthenzDomain (com.yahoo.vespa.athenz.api.AthenzDomain)2 ApplicationId (com.yahoo.config.provision.ApplicationId)1 AthenzIdentity (com.yahoo.vespa.athenz.api.AthenzIdentity)1 ChefMock (com.yahoo.vespa.hosted.controller.api.integration.chef.ChefMock)1 MockOrganization (com.yahoo.vespa.hosted.controller.api.integration.organization.MockOrganization)1 MemoryGlobalRoutingService (com.yahoo.vespa.hosted.controller.api.integration.routing.MemoryGlobalRoutingService)1 MockMetricsService (com.yahoo.vespa.hosted.controller.integration.MockMetricsService)1 MockRoutingGenerator (com.yahoo.vespa.hosted.controller.routing.MockRoutingGenerator)1