Search in sources :

Example 41 with Annotation

use of org.nextprot.api.core.domain.annotation.Annotation in project nextprot-api by calipho-sib.

the class AnnotationTest method testNoEvidence.

/*
	 * this case seems to occur (in dev at least)
	 */
@Test
public void testNoEvidence() {
    Annotation a = new Annotation();
    List<AnnotationEvidence> evidences = new ArrayList<>();
    a.setEvidences(evidences);
    Assert.assertTrue(!a.isExpressionLevelDetected().isPresent());
}
Also used : AnnotationEvidence(org.nextprot.api.core.domain.annotation.AnnotationEvidence) ArrayList(java.util.ArrayList) Annotation(org.nextprot.api.core.domain.annotation.Annotation) Test(org.junit.Test)

Example 42 with Annotation

use of org.nextprot.api.core.domain.annotation.Annotation in project nextprot-api by calipho-sib.

the class AnnotationTest method testTwoHigh.

@Test
public void testTwoHigh() {
    Annotation a = new Annotation();
    List<AnnotationEvidence> evidences = new ArrayList<>();
    evidences.add(buildEvidence("high"));
    evidences.add(buildEvidence("high"));
    a.setEvidences(evidences);
    Assert.assertTrue(a.isExpressionLevelDetected().isPresent());
    Assert.assertTrue(a.isExpressionLevelDetected().get());
}
Also used : AnnotationEvidence(org.nextprot.api.core.domain.annotation.AnnotationEvidence) ArrayList(java.util.ArrayList) Annotation(org.nextprot.api.core.domain.annotation.Annotation) Test(org.junit.Test)

Example 43 with Annotation

use of org.nextprot.api.core.domain.annotation.Annotation in project nextprot-api by calipho-sib.

the class AnnotationTest method testHighAndLow.

@Test
public void testHighAndLow() {
    Annotation a = new Annotation();
    List<AnnotationEvidence> evidences = new ArrayList<>();
    evidences.add(buildEvidence("high"));
    evidences.add(buildEvidence("low"));
    a.setEvidences(evidences);
    Assert.assertTrue(a.isExpressionLevelDetected().isPresent());
    Assert.assertTrue(a.isExpressionLevelDetected().get());
}
Also used : AnnotationEvidence(org.nextprot.api.core.domain.annotation.AnnotationEvidence) ArrayList(java.util.ArrayList) Annotation(org.nextprot.api.core.domain.annotation.Annotation) Test(org.junit.Test)

Example 44 with Annotation

use of org.nextprot.api.core.domain.annotation.Annotation in project nextprot-api by calipho-sib.

the class AnnotationTest method testEmptyExpressionLevel.

@Test
public void testEmptyExpressionLevel() {
    Annotation a = new Annotation();
    List<AnnotationEvidence> evidences = new ArrayList<>();
    evidences.add(buildEvidence(""));
    a.setEvidences(evidences);
    Assert.assertTrue(a.isExpressionLevelDetected().isPresent());
    Assert.assertTrue(!a.isExpressionLevelDetected().get());
}
Also used : AnnotationEvidence(org.nextprot.api.core.domain.annotation.AnnotationEvidence) ArrayList(java.util.ArrayList) Annotation(org.nextprot.api.core.domain.annotation.Annotation) Test(org.junit.Test)

Example 45 with Annotation

use of org.nextprot.api.core.domain.annotation.Annotation in project nextprot-api by calipho-sib.

the class AnnotationTest method testOneHigh.

@Test
public void testOneHigh() {
    Annotation a = new Annotation();
    List<AnnotationEvidence> evidences = new ArrayList<>();
    evidences.add(buildEvidence("high"));
    a.setEvidences(evidences);
    Assert.assertTrue(a.isExpressionLevelDetected().isPresent());
}
Also used : AnnotationEvidence(org.nextprot.api.core.domain.annotation.AnnotationEvidence) ArrayList(java.util.ArrayList) Annotation(org.nextprot.api.core.domain.annotation.Annotation) Test(org.junit.Test)

Aggregations

Annotation (org.nextprot.api.core.domain.annotation.Annotation)120 Test (org.junit.Test)79 CoreUnitBaseTest (org.nextprot.api.core.test.base.CoreUnitBaseTest)32 AnnotationEvidence (org.nextprot.api.core.domain.annotation.AnnotationEvidence)28 AnnotationIsoformSpecificity (org.nextprot.api.core.domain.annotation.AnnotationIsoformSpecificity)22 ArrayList (java.util.ArrayList)19 Isoform (org.nextprot.api.core.domain.Isoform)17 Entry (org.nextprot.api.core.domain.Entry)9 AnnotationCategory (org.nextprot.api.commons.constants.AnnotationCategory)7 BioObject (org.nextprot.api.core.domain.BioObject)7 PepXIsoformMatch (org.nextprot.api.web.domain.PepXResponse.PepXIsoformMatch)7 AnnotationProperty (org.nextprot.api.core.domain.annotation.AnnotationProperty)6 AnnotationSimilarityPredicate (org.nextprot.api.core.service.annotation.merge.AnnotationSimilarityPredicate)6 Collectors (java.util.stream.Collectors)5 NextProtException (org.nextprot.api.commons.exception.NextProtException)5 WebUnitBaseTest (org.nextprot.api.web.dbunit.base.mvc.WebUnitBaseTest)5 Assert (org.junit.Assert)4 CvTerm (org.nextprot.api.core.domain.CvTerm)4 Autowired (org.springframework.beans.factory.annotation.Autowired)4 java.util (java.util)3