List of usage examples for junit.framework Assert assertNotNull
static public void assertNotNull(Object object)
From source file:com.couchbase.lite.DocumentTest.java
public void testNewDocumentHasCurrentRevision() throws CouchbaseLiteException { Document document = database.createDocument(); Map<String, Object> properties = new HashMap<String, Object>(); properties.put("foo", "foo"); properties.put("bar", Boolean.FALSE); document.putProperties(properties);/*w w w . java2 s .com*/ Assert.assertNotNull(document.getCurrentRevisionId()); Assert.assertNotNull(document.getCurrentRevision()); }
From source file:org.openxdata.server.service.impl.PermissionServiceTest.java
@Test public void savePermission_shouldSavePermission() throws Exception { final String permissionName = "Permission Name"; List<Permission> permissions = permissionService.getPermissions(); Assert.assertEquals(75, permissions.size()); Assert.assertNull(permissionService.getPermission(permissionName)); permissionService.savePermission(new Permission(permissionName)); permissions = permissionService.getPermissions(); Assert.assertEquals(76, permissionService.getPermissions().size()); Assert.assertNotNull(permissionService.getPermission(permissionName)); }
From source file:org.jm.spring.controller.test.SpringMVCAPIReaderTest.java
@Test public void test_get_all_resources() { SpringMVCAPIReader mvcapiReader = new SpringMVCAPIReader("0.1", "1.1-SHAPSHOT.121026", "localhost:8080", "");/* w w w .j av a 2s. c om*/ Documentation doc = mvcapiReader.createResources(mapping); Assert.assertNotNull(doc); }
From source file:org.jasig.schedassist.impl.oraclecalendar.OracleGUIDSourceImplTest.java
@Test public void testKnownUser() throws Exception { OracleCalendarUserAccount user = new OracleCalendarUserAccount(); user.setUsername("npblair"); user.setCtcalxitemid("20000:01182"); String guid = this.oracleGUIDSource.getOracleGUID(user); Assert.assertNotNull(guid); Assert.assertEquals("200000118219869582153896", guid); }
From source file:fragment.web.StaticPagesControllerTest.java
@Test public void testhelp() { String help = controller.help(map); Assert.assertNotNull(map.get("tenant")); Assert.assertEquals(help, new String("main.help")); }
From source file:gov.nih.nci.integration.transformer.XSLTTransformerConsentTest.java
/** * Testcase for transforming Interim XML to XMLString * /* ww w.j av a 2s . co m*/ * @throws IntegrationException - IntegrationException */ @Test public void transformInterimToXMLStringTest() throws IntegrationException { xsltTransformer.initTransformer(catissueConsentXsl, baseXSLPath); final String trnsfrmdMsg = transformXML(getConsentInterimMessage()); Assert.assertNotNull(trnsfrmdMsg); }
From source file:com.currencyfair.minfraud.MinFraudImplTest.java
@Test public void testRiskScoreResponseIsExtractedFromValidHttpResponse() throws Exception { StringEntity responseEntity = new StringEntity(VALID_RESPONSE, ContentType.TEXT_PLAIN); HttpMethodFactory methodFactory = expectCreateHttpPost(); CloseableHttpResponse httpResponse = EasyMock.createMock(CloseableHttpResponse.class); expectHttpResponse(httpResponse, 200, responseEntity); expectClose(httpResponse, null);//from w w w. j a v a 2 s .c o m HttpClient client = expectHttpInvocation(httpResponse); EasyMock.replay(httpResponse); minFraudImpl.setHttpClient(client); minFraudImpl.setMethodFactory(methodFactory); minFraudImpl.setEndpoint(ENDPOINT); RiskScoreResponse response = minFraudImpl.calculateRisk(newRiskScoreRequest()); Assert.assertNotNull(response); Assert.assertEquals(new BigDecimal("23.2"), response.getRiskScore()); Assert.assertTrue(response.getGeoIpDetails().isCountryMatch()); Assert.assertFalse(response.getGeoIpDetails().isHighRiskCountry()); Assert.assertEquals("IE", response.getGeoIpDetails().getIpCountryCode()); Assert.assertEquals(Integer.valueOf(48), response.getGeoIpDetails().getDistance()); EasyMock.verify(httpResponse); }
From source file:gov.nih.nci.integration.transformer.XSLTTransformerSpecimenTest.java
/** * Testcase for transforming Interim XML to XMLString * //from ww w .j a v a2 s . c o m * @throws IntegrationException - IntegrationException */ @Test public void transformSpecimenInterimToXMLStringTest() throws IntegrationException { xsltTransformer.initTransformer(catissueSpecimenXsl, baseXSLPath); final String trnsfrmdMsg = transformXML(getInterimSpecimenXML()); Assert.assertNotNull(trnsfrmdMsg); }
From source file:org.openmrs.module.emrapi.account.AccountComponentTest.java
@Test public void shouldSavePerson() { Person person = new Person(); AccountDomainWrapper account = accountService.getAccountByPerson(person); account.setGivenName("Mark"); account.setFamilyName("Jones"); account.setGender("M"); account.save();//from w w w . java 2 s . c om Integer personId = account.getPerson().getPersonId(); Assert.assertNotNull(personId); Context.flushSession(); Context.clearSession(); Person expectedPerson = personService.getPerson(personId); Assert.assertEquals("Mark", expectedPerson.getGivenName()); Assert.assertEquals("Jones", expectedPerson.getFamilyName()); Assert.assertEquals("M", expectedPerson.getGender()); Assert.assertEquals(Context.getAuthenticatedUser(), expectedPerson.getPersonCreator()); Assert.assertNotNull(expectedPerson.getPersonDateCreated()); Assert.assertNull(account.getUser()); }
From source file:org.openmrs.module.kenyarx.mapping.ObjectObsMarshallerTest.java
@Test public void marshal_shouldConvertToObs() throws Exception { Patient patient = Context.getPatientService().getPatient(7); Concept aspirin = Context.getConceptService().getConcept(71617); Date date = new Date(); Dispensing dispensing = new Dispensing(); dispensing.setDispensedConcept(aspirin); dispensing.setDispensedQuantity(123.0); dispensing.setDispensedUnits("ml"); Obs obs = objectObsMarshaller.marshal(dispensing, null, date, patient); Assert.assertNotNull(obs); Assert.assertEquals(patient, obs.getPerson()); Assert.assertEquals(date, obs.getObsDatetime()); Obs drugObs = objectObsMarshaller.findMember(obs, Context.getConceptService().getConcept(1282)); Assert.assertNotNull(drugObs);/*w w w . j a va 2 s .c om*/ Assert.assertEquals(patient, drugObs.getPerson()); Assert.assertEquals(date, drugObs.getObsDatetime()); Assert.assertEquals(aspirin, drugObs.getValueCoded()); Obs quantityObs = objectObsMarshaller.findMember(obs, Context.getConceptService().getConcept(1443)); Assert.assertNotNull(quantityObs); Assert.assertEquals(patient, quantityObs.getPerson()); Assert.assertEquals(date, quantityObs.getObsDatetime()); Assert.assertEquals(new Double(123.0), quantityObs.getValueNumeric()); Obs unitsObs = objectObsMarshaller.findMember(obs, Context.getConceptService().getConcept(1444)); Assert.assertNotNull(unitsObs); Assert.assertEquals(patient, unitsObs.getPerson()); Assert.assertEquals(date, unitsObs.getObsDatetime()); Assert.assertEquals("ml", unitsObs.getValueText()); }