Commit d59424b5 authored by Michael Schimpelsberger's avatar Michael Schimpelsberger
Browse files

some small changes according to tests

parent b0622a7a
......@@ -6,6 +6,7 @@ public class ExceptionParam {
protected static final String SERVER_ERROR="HTTP 500 Internal Server Error";
protected static final String DOKU="";
protected static MediaType mediaType;
public static MediaType getMediaType() {
return mediaType;
......@@ -99,6 +99,7 @@ public class StudentResource {
public Response getInscriptions(@PathParam("studentMatrNr")int matrNr, @Context HttpHeaders headers) {
List<Study>list= dao.getInscriptions(matrNr);
GenericEntity<List<Study>> entity=new GenericEntity<List<Study>>(list) {};
return Response.ok(entity).build();
......@@ -112,7 +113,7 @@ public class StudentResource {
if (study.getName()==null||study.getName().isEmpty()||study.getStudyId()<=0)
throw new BadRequestException();
//check if study exists
Study temp=studyDao.getStudy(study.getStudyId());
//if study exists but has different name: BadRequest
if (!temp.getName().equals(study.getName())) {throw new BadRequestException();}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment