Search in sources :

Example 1 with SystemCodeCache

use of gov.ca.cwds.rest.api.domain.cms.SystemCodeCache in project api-core by ca-cwds.

the class SystemCodeIdValidatorTest method setupClass.

@BeforeClass
public static void setupClass() {
    SystemCodeCache systemCodeCache = new TestSystemCodeCache();
    validator = Validation.buildDefaultValidatorFactory().getValidator();
}
Also used : SystemCodeCache(gov.ca.cwds.rest.api.domain.cms.SystemCodeCache) BeforeClass(org.junit.BeforeClass)

Example 2 with SystemCodeCache

use of gov.ca.cwds.rest.api.domain.cms.SystemCodeCache in project api-core by ca-cwds.

the class CmsSystemCodeSerializerTest method buildSerializer_Args$ISystemCodeCache$boolean$boolean$boolean.

@Test
public void buildSerializer_Args$ISystemCodeCache$boolean$boolean$boolean() throws Exception {
    SystemCodeCache cache = null;
    CmsSystemCodeSerializer target = new CmsSystemCodeSerializer(cache);
    boolean showShortDescription = false;
    boolean showLogicalId = false;
    boolean showMetaCategory = false;
    CmsSystemCodeSerializer actual = target.buildSerializer(CACHE, showShortDescription, showLogicalId, showMetaCategory);
    CmsSystemCodeSerializer expected = new CmsSystemCodeSerializer(CACHE, showShortDescription, showLogicalId, showMetaCategory);
    assertThat(actual, is(equalTo(expected)));
}
Also used : SystemCodeCache(gov.ca.cwds.rest.api.domain.cms.SystemCodeCache) TestSystemCodeCache(gov.ca.cwds.rest.validation.TestSystemCodeCache) Test(org.junit.Test)

Example 3 with SystemCodeCache

use of gov.ca.cwds.rest.api.domain.cms.SystemCodeCache in project api-core by ca-cwds.

the class CmsSystemCodeSerializerTest method buildBits_Args$booleanArray.

@Test
public void buildBits_Args$booleanArray() throws Exception {
    SystemCodeCache cache = null;
    CmsSystemCodeSerializer target = new CmsSystemCodeSerializer(cache);
    // given
    boolean[] flags = new boolean[] {};
    // e.g. : given(mocked.called()).willReturn(1);
    // when
    BitSet actual = target.buildBits(flags);
    // then
    // e.g. : verify(mocked).called();
    BitSet expected = new BitSet(0);
    assertThat(actual, is(equalTo(expected)));
}
Also used : SystemCodeCache(gov.ca.cwds.rest.api.domain.cms.SystemCodeCache) TestSystemCodeCache(gov.ca.cwds.rest.validation.TestSystemCodeCache) BitSet(java.util.BitSet) Test(org.junit.Test)

Example 4 with SystemCodeCache

use of gov.ca.cwds.rest.api.domain.cms.SystemCodeCache in project api-core by ca-cwds.

the class CmsSystemCodeSerializerTest method instantiation.

@Test
public void instantiation() throws Exception {
    SystemCodeCache cache = null;
    CmsSystemCodeSerializer target = new CmsSystemCodeSerializer(cache);
    assertThat(target, notNullValue());
}
Also used : SystemCodeCache(gov.ca.cwds.rest.api.domain.cms.SystemCodeCache) TestSystemCodeCache(gov.ca.cwds.rest.validation.TestSystemCodeCache) Test(org.junit.Test)

Example 5 with SystemCodeCache

use of gov.ca.cwds.rest.api.domain.cms.SystemCodeCache in project api-core by ca-cwds.

the class CmsSystemCodeSerializerTest method serialize_Args$Short$JsonGenerator$SerializerProvider.

@Test
public void serialize_Args$Short$JsonGenerator$SerializerProvider() throws Exception {
    SystemCodeCache cache = null;
    CmsSystemCodeSerializer target = new CmsSystemCodeSerializer(cache);
    // given
    Short s = null;
    JsonGenerator jgen = mock(JsonGenerator.class);
    SerializerProvider sp = mock(SerializerProvider.class);
    // e.g. : given(mocked.called()).willReturn(1);
    // when
    target.serialize(s, jgen, sp);
// then
// e.g. : verify(mocked).called();
}
Also used : SystemCodeCache(gov.ca.cwds.rest.api.domain.cms.SystemCodeCache) TestSystemCodeCache(gov.ca.cwds.rest.validation.TestSystemCodeCache) JsonGenerator(com.fasterxml.jackson.core.JsonGenerator) SerializerProvider(com.fasterxml.jackson.databind.SerializerProvider) Test(org.junit.Test)

Aggregations

SystemCodeCache (gov.ca.cwds.rest.api.domain.cms.SystemCodeCache)8 TestSystemCodeCache (gov.ca.cwds.rest.validation.TestSystemCodeCache)4 Test (org.junit.Test)4 BeforeClass (org.junit.BeforeClass)3 JsonGenerator (com.fasterxml.jackson.core.JsonGenerator)1 SerializerProvider (com.fasterxml.jackson.databind.SerializerProvider)1 Provides (com.google.inject.Provides)1 BitSet (java.util.BitSet)1