@Test(expected = InvalidModelException.class)
 public void testCreateS3AttachmentTokenBadMD5()
     throws NumberFormatException, DatastoreException, NotFoundException, UnauthorizedException,
         InvalidModelException {
   S3AttachmentToken startToken = new S3AttachmentToken();
   startToken.setFileName("SomeFile.jpg");
   String almostMd5 = "79054025255fb1a26e4bc422aef";
   startToken.setMd5(almostMd5);
   Long tokenId = new Long(456);
   String entityId = "132";
   String userId = "007";
   String expectedPath = entityId + "/" + tokenId.toString();
   String expectePreSigneUrl = "I am a presigned url! whooot!";
   when(mocIdGenerator.generateNewId()).thenReturn(tokenId);
   Credentials mockCreds = Mockito.mock(Credentials.class);
   when(mockUuserManager.getUserInfo(userId)).thenReturn(mockUser);
   when(mockPermissionsManager.hasAccess(entityId, ACCESS_TYPE.UPDATE, mockUser)).thenReturn(true);
   when(mocKLocationHelper.createFederationTokenForS3(userId, HttpMethod.PUT, expectedPath))
       .thenReturn(mockCreds);
   when(mocKLocationHelper.presignS3PUTUrl(mockCreds, expectedPath, almostMd5, "image/jpeg"))
       .thenReturn(expectePreSigneUrl);
   // Make the actual call
   S3AttachmentToken endToken = manager.createS3AttachmentToken(userId, entityId, startToken);
   assertNotNull(endToken);
   assertEquals(expectePreSigneUrl, endToken.getPresignedUrl());
 }