Clover icon

sunshower-base

  1. Project Clover database Mon May 7 2018 22:12:38 UTC
  2. Package io.sunshower.persist.hibernate

File HibernateProviderConfigurationSourceTest.java

 

Code metrics

0
10
8
1
63
51
8
0.8
1.25
8
1

Classes

Class Line # Actions
HibernateProviderConfigurationSourceTest 18 10 8
1.0100%
 

Contributing tests

This file is covered by 8 tests. .

Source view

1    package io.sunshower.persist.hibernate;
2   
3    import static org.hamcrest.CoreMatchers.*;
4    import static org.hamcrest.CoreMatchers.nullValue;
5    import static org.hamcrest.MatcherAssert.assertThat;
6    import static org.junit.Assert.assertTrue;
7   
8    import io.sunshower.persist.HibernateTestCase;
9    import javax.inject.Inject;
10    import org.junit.jupiter.api.Test;
11    import org.junit.jupiter.api.extension.ExtendWith;
12    import org.junit.platform.runner.JUnitPlatform;
13    import org.junit.runner.RunWith;
14    import org.springframework.test.context.junit.jupiter.SpringExtension;
15   
16    @RunWith(JUnitPlatform.class)
17    @ExtendWith(SpringExtension.class)
 
18    public class HibernateProviderConfigurationSourceTest extends HibernateTestCase {
19   
20    @Inject private HibernateProviderConfigurationSource props;
21   
 
22  1 toggle @Test
23    public void ensurePropertiesAreInjected() {
24  1 assertThat(props, is(not(nullValue())));
25    }
26   
 
27  1 toggle @Test
28    public void ensureProviderIsNotNull() {
29  1 assertThat(props.getProvider(), is(not(nullValue())));
30    }
31   
 
32  1 toggle @Test
33    public void ensureDdlShowSqlExists() {
34  1 assertThat(props.ddl().showSql(), is(false));
35    }
36   
 
37  1 toggle @Test
38    public void ensureDdlGenerateExists() {
39  1 assertThat(props.ddl().generate(), is(false));
40    }
41   
 
42  1 toggle @Test
43    public void ensureSearchTypeIsCorrect() {
44  1 assertThat(props.getSearch().type(), is("hibernate.search.default.directory_provider"));
45    }
46   
 
47  1 toggle @Test
48    public void ensureSearchValueIsCorrect() {
49  1 assertThat(props.getSearch().value(), is("local-heap"));
50    }
51   
 
52  1 toggle @Test
53    public void ensureRegionFactoryIsCorrect() {
54  1 String regionFactory = props.cache().regionFactory();
55  1 assertThat(regionFactory, is("org.apache.ignite.cache.hibernate.HibernateRegionFactory"));
56    }
57   
 
58  1 toggle @Test
59    public void ensureL2CacheIsEnabled() {
60  1 boolean queryCacheEnabled = props.cache().enabled();
61  1 assertTrue(queryCacheEnabled);
62    }
63    }