Changeset 4461 for DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/rest/AnnotationResourceTest.java
- Timestamp:
- 02/06/14 12:21:44 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/rest/AnnotationResourceTest.java
r4429 r4461 80 80 public AnnotationResourceTest() { 81 81 mockRequest = new MockHttpServletRequest(); 82 mockRequest.setRemoteUser(" twan");82 mockRequest.setRemoteUser("olhsha@mpi.nl"); 83 83 84 84 } … … 91 91 public void testGetAnnotation() throws SQLException, JAXBException, Exception { 92 92 System.out.println("getAnnotation"); 93 final String externalIDstring= TestBackendConstants._TEST_ANNOT_2_EXT;93 final String externalIDstring= "00000000-0000-0000-0000-000000000021"; 94 94 final Annotation expectedAnnotation = (new TestInstances(TestBackendConstants._TEST_SERVLET_URI)).getAnnotationOne(); 95 95 annotationResource.setHttpServletRequest(mockRequest); … … 107 107 will(doAll()); 108 108 109 oneOf(mockDbIntegrityService).getUserInternalIDFromRemoteID(" twan");109 oneOf(mockDbIntegrityService).getUserInternalIDFromRemoteID("olhsha@mpi.nl"); 110 110 will(returnValue(3)); 111 111 … … 139 139 mockDelete[0]=1; // # deleted annotations 140 140 mockDelete[3]=1; // # deleted annotation_prinipal_permissions 141 mockDelete[2]=2; // # deleted annotations_target_Targets, ( 5,3), (5,4)141 mockDelete[2]=2; // # deleted annotations_target_Targets, (4,3), (4,4) 142 142 mockDelete[3]=1; // # deletd Targets, 4 143 143 … … 151 151 152 152 153 oneOf(mockDbIntegrityService).getUserInternalIDFromRemoteID(" twan");154 will(returnValue( 5));153 oneOf(mockDbIntegrityService).getUserInternalIDFromRemoteID("olhsha@mpi.nl"); 154 will(returnValue(3)); 155 155 156 156 oneOf(mockDbIntegrityService).setServiceURI(with(any(String.class))); … … 158 158 159 159 oneOf(mockDbIntegrityService).getAnnotationInternalIdentifier(with(aNonNull(UUID.class))); 160 will(returnValue( 5));161 162 163 oneOf(mockDbIntegrityService).getAnnotationOwner( 5);164 will(returnValue( 5));165 166 oneOf(mockDbIntegrityService).deleteAnnotation( 5);160 will(returnValue(4)); 161 162 163 oneOf(mockDbIntegrityService).getAnnotationOwner(4); 164 will(returnValue(3)); 165 166 oneOf(mockDbIntegrityService).deleteAnnotation(4); 167 167 will(returnValue(mockDelete)); 168 168 } … … 170 170 171 171 172 String result = annotationResource.deleteAnnotation( TestBackendConstants._TEST_ANNOT_5_EXT);172 String result = annotationResource.deleteAnnotation("00000000-0000-0000-0000-000000000024"); 173 173 assertEquals("1 annotation(s) deleted.", result); 174 174 } … … 187 187 annotationToAdd.setTargets(TargetInfoList); 188 188 annotationToAdd.setOwnerRef(null); 189 annotationToAdd.setLastModified(DatatypeFactory.newInstance().newXMLGregorianCalendar( TestBackendConstants._TEST_ANNOT_2_TIME_STAMP));189 annotationToAdd.setLastModified(DatatypeFactory.newInstance().newXMLGregorianCalendar("2013-08-12T09:25:00.383000Z")); 190 190 annotationToAdd.setHeadline("headline"); 191 191 annotationToAdd.setTargets(TargetInfoList); … … 209 209 final Annotation addedAnnotation = (new ObjectFactory()).createAnnotation(annotationToAdd).getValue(); 210 210 addedAnnotation.setURI("http://localhost:8080/annotator-backend/api/annotations/"+UUID.randomUUID().toString()); 211 addedAnnotation.setOwnerRef("http://localhost:8080/annotator-backend/api/users/"+ TestBackendConstants._TEST_USER_3_EXT_ID);211 addedAnnotation.setOwnerRef("http://localhost:8080/annotator-backend/api/users/"+"00000000-0000-0000-0000-000000000111"); 212 212 213 213 annotationResource.setHttpServletRequest(mockRequest); … … 223 223 will(doAll()); 224 224 225 oneOf(mockDbIntegrityService).getUserInternalIDFromRemoteID(" twan");225 oneOf(mockDbIntegrityService).getUserInternalIDFromRemoteID("olhsha@mpi.nl"); 226 226 will(returnValue(3)); 227 227
Note: See TracChangeset
for help on using the changeset viewer.