Search in sources :

Example 1 with AppWithNoServices

use of co.cask.cdap.AppWithNoServices in project cdap by caskdata.

the class DefaultStoreTest method testServiceDeletion.

@Test
public void testServiceDeletion() throws Exception {
    // Store the application specification
    AbstractApplication app = new AppWithServices();
    ApplicationSpecification appSpec = Specifications.from(app);
    ApplicationId appId = NamespaceId.DEFAULT.app(appSpec.getName());
    store.addApplication(appId, appSpec);
    AbstractApplication newApp = new AppWithNoServices();
    // get the delete program specs after deploying AppWithNoServices
    List<ProgramSpecification> programSpecs = store.getDeletedProgramSpecifications(appId, Specifications.from(newApp));
    // verify the result.
    Assert.assertEquals(1, programSpecs.size());
    Assert.assertEquals("NoOpService", programSpecs.get(0).getName());
}
Also used : ApplicationSpecification(co.cask.cdap.api.app.ApplicationSpecification) ProgramSpecification(co.cask.cdap.api.ProgramSpecification) AppWithServices(co.cask.cdap.AppWithServices) AbstractApplication(co.cask.cdap.api.app.AbstractApplication) AppWithNoServices(co.cask.cdap.AppWithNoServices) ApplicationId(co.cask.cdap.proto.id.ApplicationId) Test(org.junit.Test)

Aggregations

AppWithNoServices (co.cask.cdap.AppWithNoServices)1 AppWithServices (co.cask.cdap.AppWithServices)1 ProgramSpecification (co.cask.cdap.api.ProgramSpecification)1 AbstractApplication (co.cask.cdap.api.app.AbstractApplication)1 ApplicationSpecification (co.cask.cdap.api.app.ApplicationSpecification)1 ApplicationId (co.cask.cdap.proto.id.ApplicationId)1 Test (org.junit.Test)1