use of org.jboss.pnc.dto.GroupConfiguration in project pnc by project-ncl.
the class GroupConfigurationProviderTest method testStore.
@Test
public void testStore() {
final String name = "NewNAME";
final String id = "12";
org.jboss.pnc.dto.GroupConfiguration groupConfiguration = GroupConfiguration.builder().name(name).productVersion(ProductVersionRef.refBuilder().id(id).build()).build();
org.jboss.pnc.dto.GroupConfiguration stored = provider.store(groupConfiguration);
assertThat(stored).isNotNull();
assertThat(stored.getId()).isNotNull();
assertThat(stored.getName()).isEqualTo(name);
assertThat(stored.getProductVersion().getId()).isEqualTo(id);
}
use of org.jboss.pnc.dto.GroupConfiguration in project pnc by project-ncl.
the class GroupConfigurationProviderTest method testGetSpecific.
@Test
public void testGetSpecific() {
GroupConfiguration groupConfiguration = provider.getSpecific(bcs.getId().toString());
assertThat(groupConfiguration).isNotNull();
assertThat(groupConfiguration.getId()).isEqualTo(bcs.getId().toString());
assertThat(groupConfiguration.getName()).isEqualTo(bcs.getName());
}
use of org.jboss.pnc.dto.GroupConfiguration in project pnc by project-ncl.
the class GroupConfigurationProviderTest method testRemoveConfiguration.
@Test
public void testRemoveConfiguration() {
// With
//
org.jboss.pnc.dto.GroupConfiguration groupConfiguration = provider.getSpecific("1");
BuildConfiguration toRemove = bcs.getBuildConfigurations().stream().findFirst().get();
when(buildConfigurationRepository.queryById(toRemove.getId())).thenReturn(toRemove);
assertThat(groupConfiguration.getBuildConfigs()).containsKey(toRemove.getId().toString());
// When
provider.removeConfiguration(groupConfiguration.getId(), toRemove.getId().toString());
// Then
org.jboss.pnc.dto.GroupConfiguration refreshed = provider.getSpecific(groupConfiguration.getId());
assertThat(refreshed.getBuildConfigs().values()).doNotHave(new Condition<>(toRemove::equals, "BC is equal to 'toRemove' bc"));
}
Aggregations