Subversion Repositories eFlore/Applications.del

Rev

Rev 345 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 345 Rev 534
Line 1... Line 1...
1
package org.tela_botanica.del.test.vues.comparaisoneflore;
1
package org.tela_botanica.del.test.vues.comparaisoneflore;
Line 2... Line 2...
2
 
2
 
-
 
3
import static org.junit.Assert.assertTrue;
3
import static org.junit.Assert.assertTrue;
4
import static org.mockito.Mockito.doAnswer;
Line 4... Line 5...
4
import static org.mockito.Mockito.mock;
5
import static org.mockito.Mockito.mock;
5
 
6
 
-
 
7
import org.junit.Before;
-
 
8
import org.junit.Test;
-
 
9
import org.mockito.Mockito;
6
import org.junit.Before;
10
import org.mockito.invocation.InvocationOnMock;
7
import org.junit.Test;
11
import org.mockito.stubbing.Answer;
-
 
12
import org.tela_botanica.del.client.services.rest.ImageService;
8
import org.tela_botanica.del.client.cache.CacheClient;
13
import org.tela_botanica.del.client.services.rest.VoteProtocoleService;
9
import org.tela_botanica.del.client.modeles.Image;
14
import org.tela_botanica.del.client.services.rest.async.ImagesParTaxonCallback;
10
import org.tela_botanica.del.client.utils.MockDatasource;
15
import org.tela_botanica.del.client.utils.MockDatasource;
Line 11... Line 16...
11
import org.tela_botanica.del.client.vues.comparaisoneflore.ComparaisonEflorePresenteur;
16
import org.tela_botanica.del.client.vues.comparaisoneflore.ComparaisonEflorePresenteur;
Line 12... Line 17...
12
import org.tela_botanica.del.client.vues.comparaisoneflore.ComparaisonEflorePresenteur.Vue;
17
import org.tela_botanica.del.client.vues.comparaisoneflore.ComparaisonEflorePresenteur.Vue;
Line 13... Line -...
13
 
-
 
14
public class ComparaisonEflorePresenteurTest {
-
 
15
 
18
 
16
	private ComparaisonEflorePresenteur comparaisonEflorePresenteur;
19
public class ComparaisonEflorePresenteurTest {
17
 
20
 
-
 
21
	private ComparaisonEflorePresenteur comparaisonEflorePresenteur;
-
 
22
 
-
 
23
	@Before
-
 
24
	public void setUp() {
-
 
25
		Vue vue = mock(Vue.class);
18
	private Vue vue;
26
		ImageService imageService = Mockito.mock(ImageService.class);
-
 
27
		VoteProtocoleService voteProtocoleService = mock(VoteProtocoleService.class);
-
 
28
 
-
 
29
		doAnswer(new Answer<Void>() {
Line 19... Line -...
19
 
-
 
20
	@Before
-
 
21
	public void setUp() {
30
			public Void answer(InvocationOnMock invocation) {
22
		vue = mock(Vue.class);
31
				comparaisonEflorePresenteur.setImagesEflore(MockDatasource.getInstance().getImages(0, 10));
-
 
32
				return null;
23
		comparaisonEflorePresenteur = new ComparaisonEflorePresenteur(vue, MockDatasource.getInstance(), MockDatasource.getInstance());
33
			}
Line 24... Line 34...
24
 
34
		}).when(imageService).getImagesEfloreParTaxon(Mockito.anyString(), Mockito.any(ImagesParTaxonCallback.class));
25
		Image image = new Image();
35
 
26
		image.setIdImage("id image 0");
36
		comparaisonEflorePresenteur = new ComparaisonEflorePresenteur(vue, voteProtocoleService, imageService);
27
		CacheClient.getInstance().setImageCourante(image);
37
		comparaisonEflorePresenteur.chargerObservationsEflore();
Line 28... Line 38...
28
		comparaisonEflorePresenteur.chargerObservationsEflore();
38