|
| 1 | +/** |
| 2 | + * The contents of this file are subject to the OpenMRS Public License |
| 3 | + * Version 1.0 (the "License"); you may not use this file except in |
| 4 | + * compliance with the License. You may obtain a copy of the License at |
| 5 | + * http://license.openmrs.org |
| 6 | + * |
| 7 | + * Software distributed under the License is distributed on an "AS IS" |
| 8 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the |
| 9 | + * License for the specific language governing rights and limitations |
| 10 | + * under the License. |
| 11 | + * |
| 12 | + * Copyright (C) OpenMRS, LLC. All Rights Reserved. |
| 13 | + */ |
| 14 | +package org.openmrs.module.basicmodule; |
| 15 | + |
| 16 | +import java.util.Map; |
| 17 | + |
| 18 | +import org.junit.Assert; |
| 19 | +import org.junit.Test; |
| 20 | +import org.openmrs.module.Extension.MEDIA_TYPE; |
| 21 | +import org.openmrs.module.basicmodule.extension.html.AdminList; |
| 22 | + |
| 23 | +/** |
| 24 | + * This test validates the AdminList extension class |
| 25 | + */ |
| 26 | +public class AdminListExtensionTest { |
| 27 | + |
| 28 | + /** |
| 29 | + * Get the links for the extension class |
| 30 | + */ |
| 31 | + @Test |
| 32 | + public void testValidatesLinks() { |
| 33 | + AdminList ext = new AdminList(); |
| 34 | + |
| 35 | + Map<String, String> links = ext.getLinks(); |
| 36 | + |
| 37 | + Assert.assertNotNull("Some links should be returned", links); |
| 38 | + |
| 39 | + Assert.assertTrue("There should be a positive number of links", links.values().size() > 0); |
| 40 | + } |
| 41 | + |
| 42 | + /** |
| 43 | + * Check the media type of this extension class |
| 44 | + */ |
| 45 | + @Test |
| 46 | + public void testMediaTypeIsHtml() { |
| 47 | + AdminList ext = new AdminList(); |
| 48 | + |
| 49 | + Assert.assertTrue("The media type of this extension should be html", ext.getMediaType().equals(MEDIA_TYPE.html)); |
| 50 | + } |
| 51 | + |
| 52 | +} |
0 commit comments