Search in sources :

Example 1 with MockApplicationPackage

use of com.yahoo.config.model.test.MockApplicationPackage in project vespa by vespa-engine.

the class ModelContextImplTest method testModelContextTest.

@Test
public void testModelContextTest() {
    final Rotation rotation = new Rotation("this.is.a.mock.rotation");
    final Set<Rotation> rotations = Collections.singleton(rotation);
    ModelContext context = new ModelContextImpl(MockApplicationPackage.createEmpty(), Optional.empty(), Optional.empty(), new BaseDeployLogger(), new StaticConfigDefinitionRepo(), new MockFileRegistry(), Optional.empty(), new ModelContextImpl.Properties(ApplicationId.defaultId(), true, Collections.emptyList(), null, false, Zone.defaultZone(), rotations), Optional.empty(), new Version(6), new Version(6));
    assertTrue(context.applicationPackage() instanceof MockApplicationPackage);
    assertFalse(context.hostProvisioner().isPresent());
    assertFalse(context.permanentApplicationPackage().isPresent());
    assertFalse(context.previousModel().isPresent());
    assertTrue(context.getFileRegistry() instanceof MockFileRegistry);
    assertTrue(context.configDefinitionRepo() instanceof StaticConfigDefinitionRepo);
    assertThat(context.properties().applicationId(), is(ApplicationId.defaultId()));
    assertTrue(context.properties().configServerSpecs().isEmpty());
    assertTrue(context.properties().multitenant());
    assertTrue(context.properties().zone() instanceof Zone);
    assertFalse(context.properties().hostedVespa());
    assertThat(context.properties().rotations(), equalTo(rotations));
}
Also used : ModelContext(com.yahoo.config.model.api.ModelContext) MockApplicationPackage(com.yahoo.config.model.test.MockApplicationPackage) BaseDeployLogger(com.yahoo.config.model.application.provider.BaseDeployLogger) Version(com.yahoo.component.Version) Zone(com.yahoo.config.provision.Zone) ModelContextImpl(com.yahoo.vespa.config.server.deploy.ModelContextImpl) Rotation(com.yahoo.config.provision.Rotation) MockFileRegistry(com.yahoo.config.model.application.provider.MockFileRegistry) Test(org.junit.Test)

Aggregations

Version (com.yahoo.component.Version)1 ModelContext (com.yahoo.config.model.api.ModelContext)1 BaseDeployLogger (com.yahoo.config.model.application.provider.BaseDeployLogger)1 MockFileRegistry (com.yahoo.config.model.application.provider.MockFileRegistry)1 MockApplicationPackage (com.yahoo.config.model.test.MockApplicationPackage)1 Rotation (com.yahoo.config.provision.Rotation)1 Zone (com.yahoo.config.provision.Zone)1 ModelContextImpl (com.yahoo.vespa.config.server.deploy.ModelContextImpl)1 Test (org.junit.Test)1