|
|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* Copyright 2011-2012 the original author or authors. |
|
|
|
* Copyright 2011-2013 the original author or authors. |
|
|
|
* |
|
|
|
* |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
@ -42,15 +42,15 @@ import com.mongodb.gridfs.GridFSFile; |
|
|
|
* |
|
|
|
* |
|
|
|
* @author Oliver Gierke |
|
|
|
* @author Oliver Gierke |
|
|
|
* @author Philipp Schneider |
|
|
|
* @author Philipp Schneider |
|
|
|
|
|
|
|
* @author Thomas Darimont |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@RunWith(SpringJUnit4ClassRunner.class) |
|
|
|
@RunWith(SpringJUnit4ClassRunner.class) |
|
|
|
@ContextConfiguration("classpath:gridfs/gridfs.xml") |
|
|
|
@ContextConfiguration("classpath:gridfs/gridfs.xml") |
|
|
|
public class GridFsTemplateIIntegrationTests { |
|
|
|
public class GridFsTemplateIntegrationTests { |
|
|
|
|
|
|
|
|
|
|
|
Resource resource = new ClassPathResource("gridfs/gridfs.xml"); |
|
|
|
Resource resource = new ClassPathResource("gridfs/gridfs.xml"); |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
@Autowired GridFsOperations operations; |
|
|
|
GridFsOperations operations; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Before |
|
|
|
@Before |
|
|
|
public void setUp() { |
|
|
|
public void setUp() { |
|
|
|
@ -127,6 +127,14 @@ public class GridFsTemplateIIntegrationTests { |
|
|
|
assertThat(resources[0].getContentType(), is(reference.getContentType())); |
|
|
|
assertThat(resources[0].getContentType(), is(reference.getContentType())); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* @see DATAMONGO-813 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
public void getResourceShouldReturnNullForNonExistingResource() { |
|
|
|
|
|
|
|
assertThat(operations.getResource("doesnotexist"), is(nullValue())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static void assertSame(GridFSFile left, GridFSFile right) { |
|
|
|
private static void assertSame(GridFSFile left, GridFSFile right) { |
|
|
|
|
|
|
|
|
|
|
|
assertThat(left.getId(), is(right.getId())); |
|
|
|
assertThat(left.getId(), is(right.getId())); |