Search in sources :

Example 1 with AppGroupEntry

use of org.finos.waltz.model.app_group.AppGroupEntry in project waltz by khartec.

the class AppGroupDaoTest method canAddOrgUnitsToGroups.

@Test
public void canAddOrgUnitsToGroups() throws InsufficientPrivelegeException {
    Long gId = appGroupHelper.createAppGroupWithAppRefs("t3", asSet(r1));
    appGroupOuDao.addOrgUnit(gId, raOu);
    List<AppGroupEntry> ouEntries = appGroupOuDao.getEntriesForGroup(gId);
    assertEquals(1, ouEntries.size());
    AppGroupEntry entry = CollectionUtilities.first(ouEntries);
    assertEquals(EntityKind.ORG_UNIT, entry.kind());
    assertEquals(raOu, Long.valueOf(entry.id()));
}
Also used : AppGroupEntry(org.finos.waltz.model.app_group.AppGroupEntry) BaseInMemoryIntegrationTest(org.finos.waltz.integration_test.inmem.BaseInMemoryIntegrationTest) Test(org.junit.jupiter.api.Test)

Example 2 with AppGroupEntry

use of org.finos.waltz.model.app_group.AppGroupEntry in project waltz by khartec.

the class AppGroupHarness method main.

public static void main(String[] args) throws InsufficientPrivelegeException {
    System.out.println("--- start");
    ApplicationIdSelectorFactory appSelectorFactory = new ApplicationIdSelectorFactory();
    AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
    DSLContext dsl = ctx.getBean(DSLContext.class);
    FavouritesService service = ctx.getBean(FavouritesService.class);
    Collection<AppGroupEntry> appGroupEntries = service.addApplication("jessica.woodland-scott@db.com", 15792);
    System.out.println("--- done");
}
Also used : FavouritesService(org.finos.waltz.service.app_group.FavouritesService) AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) ApplicationIdSelectorFactory(org.finos.waltz.data.application.ApplicationIdSelectorFactory) DSLContext(org.jooq.DSLContext) AppGroupEntry(org.finos.waltz.model.app_group.AppGroupEntry)

Aggregations

AppGroupEntry (org.finos.waltz.model.app_group.AppGroupEntry)2 ApplicationIdSelectorFactory (org.finos.waltz.data.application.ApplicationIdSelectorFactory)1 BaseInMemoryIntegrationTest (org.finos.waltz.integration_test.inmem.BaseInMemoryIntegrationTest)1 FavouritesService (org.finos.waltz.service.app_group.FavouritesService)1 DSLContext (org.jooq.DSLContext)1 Test (org.junit.jupiter.api.Test)1 AnnotationConfigApplicationContext (org.springframework.context.annotation.AnnotationConfigApplicationContext)1