Search in sources :

Example 1 with AppWithNoServices

use of io.cdap.cdap.AppWithNoServices in project cdap by caskdata.

the class DefaultStoreTest method testServiceDeletion.

@Test
public void testServiceDeletion() {
    // 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(io.cdap.cdap.api.app.ApplicationSpecification) ProgramSpecification(io.cdap.cdap.api.ProgramSpecification) AppWithServices(io.cdap.cdap.AppWithServices) AbstractApplication(io.cdap.cdap.api.app.AbstractApplication) AppWithNoServices(io.cdap.cdap.AppWithNoServices) ApplicationId(io.cdap.cdap.proto.id.ApplicationId) Test(org.junit.Test)

Aggregations

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