| package org.eclipse.openk.elogbook.viewmodel; |
| |
| import org.eclipse.openk.elogbook.common.util.ResourceLoaderBase; |
| import org.junit.Test; |
| |
| import static org.eclipse.openk.elogbook.common.JsonGeneratorBase.getGson; |
| import static org.junit.Assert.assertEquals; |
| import static org.junit.Assert.assertFalse; |
| |
| public class ErrorReturnTest extends ResourceLoaderBase { |
| // IMPORTANT TEST!!! |
| // Make sure, our Interface produces a DEFINED Json! |
| // Changes in the interface will HOPEFULLY crash here!!! |
| |
| @Test |
| public void TestStructureAgainstJson() { |
| String json = super.loadStringFromResource("testErrorReturn.json"); |
| ErrorReturn errRet = getGson().fromJson(json, ErrorReturn.class); |
| assertFalse(errRet.getErrorText().isEmpty()); |
| assertEquals(errRet.getErrorCode(), 999); |
| } |
| |
| @Test |
| public void TestSetters() { |
| ErrorReturn errRet = new ErrorReturn(); |
| errRet.setErrorCode(1); |
| errRet.setErrorText("bla bla"); |
| } |
| |
| } |