use of org.jboss.pnc.client.GroupConfigurationClient in project pnc by project-ncl.
the class GroupConfigurationEndpointTest method testCreatingExistingConflicts.
@Test
public void testCreatingExistingConflicts() throws ClientException {
GroupConfigurationClient client = new GroupConfigurationClient(RestClientConfiguration.asUser());
String gcId = "100";
GroupConfiguration existing = client.getSpecific(gcId).toBuilder().id(null).build();
assertThatThrownBy(() -> client.createNew(existing)).hasCauseInstanceOf(ClientErrorException.class).has(new Condition<Throwable>((e -> ((ClientErrorException) e.getCause()).getResponse().getStatus() == 409), "Has Cause with conflicted status code 409"));
}
Aggregations