r2179 - in trunk/wao-persistence/src: main/java/fr/ifremer/wao/entity test/java/fr/ifremer/wao/entity
Author: bleny Date: 2014-07-29 15:18:07 +0200 (Tue, 29 Jul 2014) New Revision: 2179 Url: http://forge.codelutin.com/projects/wao/repository/revisions/2179 Log: refs #4481 remove a contactState value that was only for obsDeb Added: trunk/wao-persistence/src/test/java/fr/ifremer/wao/entity/ContactStateTest.java Modified: trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/ContactState.java Modified: trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/ContactState.java =================================================================== --- trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/ContactState.java 2014-07-29 12:20:29 UTC (rev 2178) +++ trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/ContactState.java 2014-07-29 13:18:07 UTC (rev 2179) @@ -65,11 +65,8 @@ CONTACT_REFUSED(n("ContactState.CONTACT_REFUSED"), true ,true, false), /** After a contact refused, people contacted still refuse the observation. Observer may not try later. */ - CONTACT_DEFINITELY_REFUSED(n("ContactState.CONTACT_DEFINITELY_REFUSED"), true, true, false), + CONTACT_DEFINITELY_REFUSED(n("ContactState.CONTACT_DEFINITELY_REFUSED"), true, true, false); - /** On the work field, observer choose not to get in touch with the people from the boat */ - OBSERVATION_NOT_DONE(n("ContactState.OBSERVATION_NOT_DONE"), true, false, false); - private String i18nKey; /** if true, the state may not be changed. */ @@ -120,7 +117,7 @@ public boolean isAllowed(ObsProgram obsProgram) { boolean allowed; if (obsProgram == ObsProgram.OBSMER) { - allowed = this != OBSERVATION_NOT_DONE; + allowed = true; } else if (obsProgram == ObsProgram.OBSVENTE) { allowed = allowedForObsVente; } else { Added: trunk/wao-persistence/src/test/java/fr/ifremer/wao/entity/ContactStateTest.java =================================================================== --- trunk/wao-persistence/src/test/java/fr/ifremer/wao/entity/ContactStateTest.java (rev 0) +++ trunk/wao-persistence/src/test/java/fr/ifremer/wao/entity/ContactStateTest.java 2014-07-29 13:18:07 UTC (rev 2179) @@ -0,0 +1,18 @@ +package fr.ifremer.wao.entity; + +import org.junit.Assert; +import org.junit.Test; + +public class ContactStateTest { + + @Test + public void testContacts() { + + for (ContactState contactState : ContactState.values()) { + Assert.assertTrue( + "value " + contactState + " is allowed for no program", + contactState.isAllowed(ObsProgram.OBSMER) || contactState.isAllowed(ObsProgram.OBSVENTE)); + } + + } +} \ No newline at end of file
participants (1)
-
bleny@users.forge.codelutin.com