Search in sources :

Example 6 with User

use of org.jboss.pnc.dto.User in project pnc by project-ncl.

the class BuildConfigurationProviderImpl method store.

@Override
public BuildConfiguration store(BuildConfiguration restEntity) throws DTOValidationException {
    validateBeforeSaving(restEntity);
    Long id = sequenceHandlerRepository.getNextID(org.jboss.pnc.model.BuildConfiguration.SEQUENCE_NAME);
    org.jboss.pnc.model.User currentUser = userService.currentUser();
    User user = userMapper.toDTO(currentUser);
    return super.store(restEntity.toBuilder().id(id.toString()).creationUser(user).modificationUser(user).build(), false);
}
Also used : User(org.jboss.pnc.dto.User)

Aggregations

User (org.jboss.pnc.dto.User)6 ContainerTest (org.jboss.pnc.test.category.ContainerTest)3 Test (org.junit.Test)3 Instant (java.time.Instant)2 BuildClient (org.jboss.pnc.client.BuildClient)2 UserClient (org.jboss.pnc.client.UserClient)2 RestAssured.given (io.restassured.RestAssured.given)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 Field (java.lang.reflect.Field)1 ArrayList (java.util.ArrayList)1 Collections (java.util.Collections)1 HashSet (java.util.HashSet)1 Iterator (java.util.Iterator)1 List (java.util.List)1 Optional (java.util.Optional)1 Set (java.util.Set)1 Collectors (java.util.stream.Collectors)1 RolesAllowed (javax.annotation.security.RolesAllowed)1 BadRequestException (javax.ws.rs.BadRequestException)1