Search in sources :

Example 1 with AdminDashboard

use of org.estatio.module.application.app.AdminDashboard in project estatio by estatio.

the class AdminDashboard_patchDatabase_IntegTest method happyCase.

@Test
public void happyCase() throws Exception {
    // given
    final AdminDashboard dashboard = administrationMenu.openAdminDashboard();
    Country country = Country_enum.GBR.findUsing(serviceRegistry);
    final Long id = factoryService.mixin(Persistable_datanucleusIdLong.class, country).prop();
    // when
    final String newName = "Great Britain";
    final String sql = String.format("UPDATE \"incodeCountry\".\"Country\" SET \"name\" = '%s' WHERE \"id\" = %d", newName, id);
    dashboard.patchDatabase(sql);
    sessionManagementService.nextSession();
    // then
    country = Country_enum.GBR.findUsing(serviceRegistry);
    Assertions.assertThat(country.getName()).isEqualTo(newName);
}
Also used : Persistable_datanucleusIdLong(org.apache.isis.core.metamodel.services.jdosupport.Persistable_datanucleusIdLong) Persistable_datanucleusIdLong(org.apache.isis.core.metamodel.services.jdosupport.Persistable_datanucleusIdLong) Country(org.incode.module.country.dom.impl.Country) AdminDashboard(org.estatio.module.application.app.AdminDashboard) Test(org.junit.Test)

Aggregations

Persistable_datanucleusIdLong (org.apache.isis.core.metamodel.services.jdosupport.Persistable_datanucleusIdLong)1 AdminDashboard (org.estatio.module.application.app.AdminDashboard)1 Country (org.incode.module.country.dom.impl.Country)1 Test (org.junit.Test)1