Search in sources :

Example 6 with PipeConfValue

use of com.epam.pipeline.entity.metadata.PipeConfValue in project cloud-pipeline by epam.

the class MetadataEntityConverterTest method shouldFailWithMissingColumnInData.

@Test(expected = IllegalStateException.class)
public void shouldFailWithMissingColumnInData() {
    Map<String, PipeConfValue> participantData1 = new HashMap<>();
    participantData1.put(TEST_ARGUMENT1, new PipeConfValue(STRING_TYPE, TEST_VALUE_1));
    participantData1.put(TEST_ARGUMENT2, new PipeConfValue(STRING_TYPE, "F"));
    MetadataEntity participant1 = getEntity(participantClass, PARTICIPANT_ENTITY_ID1, participantData1);
    Map<String, PipeConfValue> participantData2 = new HashMap<>();
    participantData2.put(TEST_ARGUMENT2, new PipeConfValue(STRING_TYPE, "M"));
    MetadataEntity participant2 = getEntity(participantClass, PARTICIPANT_ENTITY_ID2, participantData2);
    List<MetadataEntity> entities = new ArrayList<>();
    entities.add(participant1);
    entities.add(participant2);
    MetadataEntityConverter.convert(entities);
}
Also used : MetadataEntity(com.epam.pipeline.entity.metadata.MetadataEntity) PipeConfValue(com.epam.pipeline.entity.metadata.PipeConfValue) Test(org.junit.Test)

Example 7 with PipeConfValue

use of com.epam.pipeline.entity.metadata.PipeConfValue in project cloud-pipeline by epam.

the class MetadataEntityConverterTest method shouldFailIfPairSetWithoutPairs.

@Test(expected = IllegalStateException.class)
public void shouldFailIfPairSetWithoutPairs() {
    Map<String, PipeConfValue> pairSetData = new HashMap<>();
    pairSetData.put(TEST_ARGUMENT1, new PipeConfValue(STRING_TYPE, TEST_VALUE_2));
    MetadataEntity pairSet = getEntity(pairSetClass, "HCC_pairs", pairSetData);
    MetadataEntityConverter.convert(Collections.singletonList(pairSet));
}
Also used : MetadataEntity(com.epam.pipeline.entity.metadata.MetadataEntity) PipeConfValue(com.epam.pipeline.entity.metadata.PipeConfValue) Test(org.junit.Test)

Example 8 with PipeConfValue

use of com.epam.pipeline.entity.metadata.PipeConfValue in project cloud-pipeline by epam.

the class MetadataEntityConverterTest method shouldFailIfSampleSetWithoutSamples.

@Test(expected = IllegalStateException.class)
public void shouldFailIfSampleSetWithoutSamples() {
    Map<String, PipeConfValue> sampleSetData = new HashMap<>();
    sampleSetData.put(TEST_ARGUMENT1, new PipeConfValue(STRING_TYPE, TEST_VALUE_2));
    MetadataEntity sampleSet = getEntity(sampleSetClass, "HCC_samples", sampleSetData);
    MetadataEntityConverter.convert(Collections.singletonList(sampleSet));
}
Also used : MetadataEntity(com.epam.pipeline.entity.metadata.MetadataEntity) PipeConfValue(com.epam.pipeline.entity.metadata.PipeConfValue) Test(org.junit.Test)

Example 9 with PipeConfValue

use of com.epam.pipeline.entity.metadata.PipeConfValue in project cloud-pipeline by epam.

the class MetadataEntityConverterTest method shouldFailIfPairWithoutControlSampleAttribute.

@Test(expected = IllegalArgumentException.class)
public void shouldFailIfPairWithoutControlSampleAttribute() {
    Map<String, PipeConfValue> pairData = new HashMap<>();
    pairData.put(PARTICIPANT_TYPE_NAME, new PipeConfValue(PARTICIPANT_TYPE_NAME, PARTICIPANT_ENTITY_ID1));
    pairData.put(CASE_SAMPLE_ARGUMENT, new PipeConfValue(SAMPLE_ATTRIBUTE_TYPE, SAMPLE_ENTITY_ID2));
    MetadataEntity pair = getEntity(pairClass, PAIR_ENTITY_ID1, pairData);
    MetadataEntityConverter.convert(Collections.singletonList(pair));
}
Also used : MetadataEntity(com.epam.pipeline.entity.metadata.MetadataEntity) PipeConfValue(com.epam.pipeline.entity.metadata.PipeConfValue) Test(org.junit.Test)

Example 10 with PipeConfValue

use of com.epam.pipeline.entity.metadata.PipeConfValue in project cloud-pipeline by epam.

the class MetadataEntityConverterTest method shouldFailWithInconsistentData.

@Test(expected = IllegalStateException.class)
public void shouldFailWithInconsistentData() {
    Map<String, PipeConfValue> participantData1 = new HashMap<>();
    participantData1.put(TEST_ARGUMENT1, new PipeConfValue(STRING_TYPE, TEST_VALUE_1));
    MetadataEntity participant1 = getEntity(participantClass, PARTICIPANT_ENTITY_ID1, participantData1);
    Map<String, PipeConfValue> participantData2 = new HashMap<>();
    participantData2.put(TEST_ARGUMENT2, new PipeConfValue(STRING_TYPE, "M"));
    MetadataEntity participant2 = getEntity(participantClass, PARTICIPANT_ENTITY_ID2, participantData2);
    List<MetadataEntity> entities = new ArrayList<>();
    entities.add(participant1);
    entities.add(participant2);
    MetadataEntityConverter.convert(entities);
}
Also used : MetadataEntity(com.epam.pipeline.entity.metadata.MetadataEntity) PipeConfValue(com.epam.pipeline.entity.metadata.PipeConfValue) Test(org.junit.Test)

Aggregations

PipeConfValue (com.epam.pipeline.entity.metadata.PipeConfValue)41 Test (org.junit.Test)24 MetadataEntity (com.epam.pipeline.entity.metadata.MetadataEntity)21 HashMap (java.util.HashMap)11 Transactional (org.springframework.transaction.annotation.Transactional)11 AbstractSpringTest (com.epam.pipeline.AbstractSpringTest)9 EntityVO (com.epam.pipeline.controller.vo.EntityVO)9 Folder (com.epam.pipeline.entity.pipeline.Folder)9 MetadataEntry (com.epam.pipeline.entity.metadata.MetadataEntry)8 FolderWithMetadata (com.epam.pipeline.entity.metadata.FolderWithMetadata)5 MetadataClass (com.epam.pipeline.entity.metadata.MetadataClass)5 PasswordGenerator.generateRandomString (com.epam.pipeline.utils.PasswordGenerator.generateRandomString)5 Map (java.util.Map)5 ArrayList (java.util.ArrayList)4 HashSet (java.util.HashSet)4 MetadataEntityVO (com.epam.pipeline.controller.vo.metadata.MetadataEntityVO)3 MessageConstants (com.epam.pipeline.common.MessageConstants)2 MessageHelper (com.epam.pipeline.common.MessageHelper)2 MetadataVO (com.epam.pipeline.controller.vo.MetadataVO)2 BaseEntity (com.epam.pipeline.entity.BaseEntity)2