SuperX-Kernmodul
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

38 lines
1.3 KiB

package de.superx.saiku;
import static org.junit.Assert.assertEquals;
import java.lang.reflect.Field;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.saiku.service.PlatformUtilsService;
/**
* Test for class {@linkplain de.superx.saiku.SuperxInfoResource}
* @author hiber
*/
public class SuperxInfoResourceTest {
private SuperxInfoResource superxInfoResource = new SuperxInfoResource();
@Mock
private PlatformUtilsService platformUtilsService ;
@Before
public void setup() throws SecurityException, IllegalArgumentException {
this.platformUtilsService = Mockito.mock(PlatformUtilsService.class);
}
@Test
public void testSetPlatformUtilsService() throws SecurityException, IllegalArgumentException, NoSuchFieldException, IllegalAccessException {
this.superxInfoResource.setPlatformUtilsService(this.platformUtilsService);
Field platformServiceField = this.superxInfoResource.getClass().getDeclaredField("platformService");
platformServiceField.setAccessible(true);
PlatformUtilsService privatePlatformService = (PlatformUtilsService) platformServiceField.get(this.superxInfoResource);
assertEquals("passed platformUtilsService equals returned platformUtilsService", privatePlatformService, this.platformUtilsService);
}
}