Skip to content
Snippets Groups Projects
Commit 98d6384e authored by kbeyro's avatar kbeyro
Browse files

delete appbase from appstateperdomain

parent 8b5451c0
Branches
Tags
3 merge requests!65Resolve "Prevent users from adding an existing SSH key",!601.6.5 fix processing bulk,!27delete appbase from appstateperdomain
Pipeline #89188 passed
......@@ -473,4 +473,22 @@ public class DomainServiceTest {
assertEquals(0, domain2.getApplicationStatePerDomain().size());
}
@Test
void shouldRemoveAppBaseFromAllDomainGroup() {
ApplicationBase applicationBase = new ApplicationBase(1L, "appBase");
ApplicationStatePerDomain statePerDomain = new ApplicationStatePerDomain(applicationBase);
DomainGroup domainGroup = new DomainGroup("test", "test1");
DomainGroup domainGroup2 = new DomainGroup("test2", "test2");
domainGroup.setApplicationStatePerDomain(new ArrayList<>(List.of(statePerDomain)));
domainGroup2.setApplicationStatePerDomain(new ArrayList<>(List.of(statePerDomain)));
when(domainGroupRepository.findAll()).thenReturn(List.of(domainGroup, domainGroup2));
domainGroupService.deleteAppBaseFromAllAppState(applicationBase);
assertEquals(0, domainGroup.getApplicationStatePerDomain().size());
assertEquals(0, domainGroup2.getApplicationStatePerDomain().size());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment