@@ -0,0 +1,2325 @@
+package uk.ac.ebi.quickgo.ontology.model;%0A%0Aimport javax.validation.Validator;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.context.annotation.Bean;%0Aimport org.springframework.test.context.ContextConfiguration;%0Aimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;%0Aimport org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;%0A%0Aimport static org.hamcrest.MatcherAssert.assertThat;%0Aimport static org.hamcrest.Matchers.hasSize;%0A%0A/**%0A * Check the operation of the java.validation.constraints for the GraphRepresentation class.%0A * @author Tony Wardell%0A * Date: 19/02/2018%0A * Time: 11:10%0A * Created with IntelliJ IDEA.%0A */%0A@RunWith(SpringJUnit4ClassRunner.class)%0A@ContextConfiguration(classes = GraphRequestValidationIT.GraphRequestValidationConfig.class)%0Apublic class GraphRequestValidationIT %7B%0A%0A    static class GraphRequestValidationConfig %7B%0A%0A        @Bean%0A        Validator validator() %7B%0A            return new LocalValidatorFactoryBean();%0A        %7D%0A    %7D%0A%0A    @Autowired%0A    private Validator validator;%0A%0A    private GraphRequest graphRequest;%0A%0A    @Before%0A    public void setUp() %7B%0A        graphRequest = new GraphRequest();%0A    %7D%0A%0A    @Test%0A    public void termBoxHeightMinimum1() %7B%0A        graphRequest.setTermBoxHeight(1);%0A%0A        assertThat(validator.validate(graphRequest), hasSize(0));%0A    %7D%0A%0A    @Test%0A    public void termBoxHeightCannotBeZero() %7B%0A        graphRequest.setTermBoxHeight(0);%0A%0A        assertThat(validator.validate(graphRequest), hasSize(1));%0A    %7D%0A%0A    @Test%0A    public void termBoxHeightCannotBeLessThan1() %7B%0A        graphRequest.setTermBoxHeight(-1);%0A%0A        assertThat(validator.validate(graphRequest), hasSize(1));%0A    %7D%0A%0A    @Test%0A    public void termBoxWidthMinimum1() %7B%0A        graphRequest.setTermBoxWidth(1);%0A%0A        assertThat(validator.validate(graphRequest), hasSize(0));%0A    %7D%0A%0A    @Test%0A    public void termBoxWidthCannotBeZero() %7B%0A        graphRequest.setTermBoxWidth(0);%0A%0A        assertThat(validator.validate(graphRequest), hasSize(1));%0A    %7D%0A%0A    @Test%0A    public void termBoxWidthCannotBeLessThan1() %7B%0A        graphRequest.setTermBoxWidth(-1);%0A%0A        assertThat(validator.validate(graphRequest), hasSize(1));%0A    %7D%0A%7D%0A

Check the operation of the java.validation.constraints for the GraphRepresentation class.