use of org.springframework.http.converter.StringHttpMessageConverter in project molgenis by molgenis.
the class MolgenisWebAppConfig method configureMessageConverters.
@Override
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
converters.add(gsonHttpMessageConverter);
converters.add(new BufferedImageHttpMessageConverter());
converters.add(new CsvHttpMessageConverter());
converters.add(new ResourceHttpMessageConverter());
converters.add(new StringHttpMessageConverter());
converters.add(rdfConverter);
}
use of org.springframework.http.converter.StringHttpMessageConverter in project molgenis by molgenis.
the class OneClickImporterControllerTest method before.
@BeforeMethod
public void before() {
OneClickImporterController oneClickImporterController = new OneClickImporterController(menuReaderService, appSettings, userAccountService, fileStore, oneClickImportJobExecutionFactory, jobExecutor);
Menu menu = mock(Menu.class);
when(menu.findMenuItemPath(OneClickImporterController.ONE_CLICK_IMPORTER)).thenReturn("/test-path");
when(menuReaderService.getMenu()).thenReturn(menu);
when(localeResolver.resolveLocale(any())).thenReturn(new Locale("nl"));
when(appSettings.getLanguageCode()).thenReturn("en");
User user = mock(User.class);
when(user.isSuperuser()).thenReturn(false);
when(userAccountService.getCurrentUser()).thenReturn(user);
OneClickImportJobExecution jobExecution = mock(OneClickImportJobExecution.class);
when(oneClickImportJobExecutionFactory.create()).thenReturn(jobExecution);
EntityType oneClickImportJobExecutionEntityType = mock(EntityType.class);
when(jobExecution.getEntityType()).thenReturn(oneClickImportJobExecutionEntityType);
when(jobExecution.getIdValue()).thenReturn("id_1");
when(oneClickImportJobExecutionEntityType.getId()).thenReturn("jobExecutionId");
StringHttpMessageConverter stringConverter = new StringHttpMessageConverter();
stringConverter.setWriteAcceptCharset(false);
mockMvc = MockMvcBuilders.standaloneSetup(oneClickImporterController).setLocaleResolver(localeResolver).setMessageConverters(gsonHttpMessageConverter, stringConverter).build();
}
use of org.springframework.http.converter.StringHttpMessageConverter in project molgenis by molgenis.
the class MappingServiceControllerTest method beforeTest.
@BeforeMethod
public void beforeTest() {
me = mock(User.class);
when(me.getUsername()).thenReturn("fdlk");
TestingAuthenticationToken authentication = new TestingAuthenticationToken("fdlk", null);
authentication.setAuthenticated(true);
SecurityContextHolder.getContext().setAuthentication(authentication);
hop = entityTypeFactory.create("HOP");
ageAttr = attrMetaFactory.create().setName("age").setDataType(INT);
hop.addAttribute(ageAttr);
dobAttr = attrMetaFactory.create().setName("dob").setDataType(DATE);
hop.addAttribute(dobAttr);
hop.setAbstract(true);
lifeLines = entityTypeFactory.create("LifeLines");
mappingProject = new MappingProject("hop hop hop", me);
mappingProject.setIdentifier("asdf");
MappingTarget mappingTarget = mappingProject.addTarget(hop);
EntityMapping entityMapping = mappingTarget.addSource(lifeLines);
AttributeMapping attributeMapping = entityMapping.addAttributeMapping("age");
attributeMapping.setAlgorithm("$('dob').age()");
when(dataService.getMeta()).thenReturn(metaDataService);
mockMvc = MockMvcBuilders.standaloneSetup(controller).setMessageConverters(gsonHttpMessageConverter, new StringHttpMessageConverter()).build();
}
use of org.springframework.http.converter.StringHttpMessageConverter in project codekvast by crispab.
the class AgentControllerTest method setup.
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
this.mockMvc = MockMvcBuilders.standaloneSetup(agentController).setMessageConverters(new GsonHttpMessageConverter(), new StringHttpMessageConverter()).build();
}
use of org.springframework.http.converter.StringHttpMessageConverter in project nakadi by zalando.
the class WebConfig method configureMessageConverters.
@Override
protected void configureMessageConverters(final List<HttpMessageConverter<?>> converters) {
final StringHttpMessageConverter stringConverter = new StringHttpMessageConverter();
stringConverter.setWriteAcceptCharset(false);
converters.add(new ByteArrayHttpMessageConverter());
converters.add(stringConverter);
converters.add(new ResourceHttpMessageConverter());
converters.add(new SourceHttpMessageConverter<>());
converters.add(mappingJackson2HttpMessageConverter());
super.configureMessageConverters(converters);
}
Aggregations