Search in sources :

Example 1 with TestProperties

use of com.blackducksoftware.integration.hub.alert.TestProperties in project hub-alert by blackducksoftware.

the class ChannelFreemarkerTemplatingServiceTest method testSubjectLine.

@Test
public void testSubjectLine() throws IOException, TemplateException {
    final TestProperties testProperties = new TestProperties();
    final ChannelFreemarkerTemplatingService channelFreemarkerTemplatingService = new ChannelFreemarkerTemplatingService(testProperties.getProperty(TestPropertyKey.TEST_EMAIL_TEMPLATE));
    final String subjectLine = channelFreemarkerTemplatingService.getResolvedSubjectLine(new HashMap<>());
    assertEquals("Default Subject Line - please define one", subjectLine);
}
Also used : TestProperties(com.blackducksoftware.integration.hub.alert.TestProperties) Test(org.junit.Test)

Example 2 with TestProperties

use of com.blackducksoftware.integration.hub.alert.TestProperties in project hub-alert by blackducksoftware.

the class LoginControllerTestIT method testLogin.

@Test
public void testLogin() throws Exception {
    final MockHttpServletRequestBuilder request = MockMvcRequestBuilders.post(loginUrl);
    final TestProperties testProperties = new TestProperties();
    final MockLoginRestModel mockLoginRestModel = new MockLoginRestModel();
    mockLoginRestModel.setHubUsername(testProperties.getProperty(TestPropertyKey.TEST_USERNAME));
    mockLoginRestModel.setHubPassword(testProperties.getProperty(TestPropertyKey.TEST_PASSWORD));
    globalProperties.setHubTrustCertificate(Boolean.valueOf(testProperties.getProperty(TestPropertyKey.TEST_TRUST_HTTPS_CERT)));
    globalProperties.setHubUrl(testProperties.getProperty(TestPropertyKey.TEST_HUB_SERVER_URL));
    final String restModel = mockLoginRestModel.getRestModelJson();
    request.content(restModel);
    request.contentType(contentType);
    mockMvc.perform(request).andExpect(MockMvcResultMatchers.status().isOk());
}
Also used : TestProperties(com.blackducksoftware.integration.hub.alert.TestProperties) MockLoginRestModel(com.blackducksoftware.integration.hub.alert.mock.model.MockLoginRestModel) MockHttpServletRequestBuilder(org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder) ExternalConnectionTest(com.blackducksoftware.integration.test.annotation.ExternalConnectionTest) Test(org.junit.Test)

Example 3 with TestProperties

use of com.blackducksoftware.integration.hub.alert.TestProperties in project hub-alert by blackducksoftware.

the class ChannelTest method init.

@Before
public void init() throws IOException {
    gson = new Gson();
    properties = new TestProperties();
    outputLogger = new OutputLogger();
}
Also used : TestProperties(com.blackducksoftware.integration.hub.alert.TestProperties) Gson(com.google.gson.Gson) OutputLogger(com.blackducksoftware.integration.hub.alert.OutputLogger) Before(org.junit.Before)

Aggregations

TestProperties (com.blackducksoftware.integration.hub.alert.TestProperties)3 Test (org.junit.Test)2 OutputLogger (com.blackducksoftware.integration.hub.alert.OutputLogger)1 MockLoginRestModel (com.blackducksoftware.integration.hub.alert.mock.model.MockLoginRestModel)1 ExternalConnectionTest (com.blackducksoftware.integration.test.annotation.ExternalConnectionTest)1 Gson (com.google.gson.Gson)1 Before (org.junit.Before)1 MockHttpServletRequestBuilder (org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder)1