Project

General

Profile

Revision a67b8f0c

IDa67b8f0c06ad2d0b191ff3bebb4c8faa11be7c92
Parent f5295f3f
Child 87926c7b

Added by Andreas Müller almost 5 years ago

#5931 Fix taxon cache strategy does not reflect protected flag in sec
reference

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/cache/taxon/TaxonBaseDefaultCacheStrategy.java
129 129
        }
130 130
        else{
131 131
            //existing sec
132
            if (ref.getCacheStrategy() != null &&
132
            if (ref.isProtectedTitleCache() == false &&
133
                    ref.getCacheStrategy() != null &&
133 134
                    ref.getAuthorship() != null &&
134 135
                    isNotBlank(ref.getAuthorship().getTitleCache()) &&
135 136
                    isNotBlank(ref.getYear())){
cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/cache/taxon/TaxonBaseDefaultCacheStrategyTest.java
183 183
	}
184 184

  
185 185
    @Test
186
    public void testProtectedSecTitleCache(){
187
        TaxonBase<?> taxonBase = Taxon.NewInstance(name, sec);
188
        sec.setTitleCache("My protected sec ref", true);
189
        taxonBase.setDoubtful(true);
190
        taxonBase.setSecMicroReference("123");
191
        Assert.assertEquals("?Abies alba (L.) Mill. sec. My protected sec ref: 123", taxonBase.getTitleCache());
192
    }
193

  
194
    @Test
186 195
    public void testMicroReference(){
187 196
        TaxonBase<?> taxonBase = Taxon.NewInstance(name, sec);
188 197
        String secMicroRef = "p. 553";

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)