|
1 | 1 | /*
|
2 |
| - * Copyright 2013 the original author or authors. |
| 2 | + * Copyright 2014 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
32 | 32 | @RunWith(MockitoJUnitRunner.class)
|
33 | 33 | public class ElasticsearchEntityInformationCreatorImplTest {
|
34 | 34 |
|
35 |
| - @Mock |
36 |
| - private MappingContext<? extends ElasticsearchPersistentEntity<?>, ElasticsearchPersistentProperty> mappingContext; |
37 |
| - @Mock |
38 |
| - private ElasticsearchPersistentEntity<String> persistentEntity; |
39 |
| - private ElasticsearchEntityInformationCreatorImpl entityInfoCreator; |
40 |
| - |
41 |
| - @Before |
42 |
| - public void before() { |
43 |
| - entityInfoCreator = new ElasticsearchEntityInformationCreatorImpl(mappingContext); |
44 |
| - } |
45 |
| - |
46 |
| - @Test(expected = IllegalArgumentException.class) |
47 |
| - public void shouldThrowIllegalArgumentExceptionOnMissingEntity() { |
48 |
| - entityInfoCreator.getEntityInformation(String.class); |
49 |
| - } |
50 |
| - |
51 |
| - @Test(expected = IllegalArgumentException.class) |
52 |
| - public void shouldThrowIllegalArgumentExceptionOnMissingIdAnnotation() { |
53 |
| - doReturn(persistentEntity).when(mappingContext).getPersistentEntity(String.class); |
54 |
| - doReturn(String.class).when(persistentEntity).getType(); |
55 |
| - doReturn(null).when(persistentEntity).getIdProperty(); |
56 |
| - entityInfoCreator.getEntityInformation(String.class); |
57 |
| - } |
58 |
| - |
| 35 | + @Mock |
| 36 | + private MappingContext<? extends ElasticsearchPersistentEntity<?>, ElasticsearchPersistentProperty> mappingContext; |
| 37 | + @Mock |
| 38 | + private ElasticsearchPersistentEntity<String> persistentEntity; |
| 39 | + private ElasticsearchEntityInformationCreatorImpl entityInfoCreator; |
| 40 | + |
| 41 | + @Before |
| 42 | + public void before() { |
| 43 | + entityInfoCreator = new ElasticsearchEntityInformationCreatorImpl(mappingContext); |
| 44 | + } |
| 45 | + |
| 46 | + @Test(expected = IllegalArgumentException.class) |
| 47 | + public void shouldThrowIllegalArgumentExceptionOnMissingEntity() { |
| 48 | + entityInfoCreator.getEntityInformation(String.class); |
| 49 | + } |
| 50 | + |
| 51 | + @Test(expected = IllegalArgumentException.class) |
| 52 | + public void shouldThrowIllegalArgumentExceptionOnMissingIdAnnotation() { |
| 53 | + doReturn(persistentEntity).when(mappingContext).getPersistentEntity(String.class); |
| 54 | + doReturn(String.class).when(persistentEntity).getType(); |
| 55 | + doReturn(null).when(persistentEntity).getIdProperty(); |
| 56 | + entityInfoCreator.getEntityInformation(String.class); |
| 57 | + } |
59 | 58 | }
|
0 commit comments