Fix unit tests

This commit is contained in:
René Pfeuffer
2018-06-15 11:27:46 +02:00
parent 8a8858407d
commit b73349c741
2 changed files with 4 additions and 1 deletions

View File

@@ -88,6 +88,9 @@ public class UserCollectionResource extends AbstractManagerResource<User, UserEx
})
@TypeHint(TypeHint.NO_CONTENT.class)
public Response create(@Context UriInfo uriInfo, UserDto userDto) throws IOException, UserException {
if (userDto == null) {
return Response.status(400).build();
}
User user = dtoToUserMapper.map(userDto, "");
manager.create(user);
return Response.created(URI.create(user(uriInfo).self(user.getName()))).build();

View File

@@ -39,7 +39,7 @@ public class GroupCollectionToDtoMapperTest {
@Before
public void init() throws URISyntaxException {
// uriInfoStore.set(uriInfo);
uriInfoStore.set(uriInfo);
URI baseUri = new URI("http://example.com/base/");
expectedBaseUri = baseUri.resolve(GroupV2Resource.GROUPS_PATH_V2 + "/");
when(uriInfo.getBaseUri()).thenReturn(baseUri);