use of com.ctrip.framework.apollo.biz.service.ReleaseService in project apollo by ctripcorp.
the class ReleaseControllerTest method testMessageSendAfterBuildRelease.
@Test
public void testMessageSendAfterBuildRelease() throws Exception {
String someAppId = "someAppId";
String someNamespaceName = "someNamespace";
String someCluster = "someCluster";
String someName = "someName";
String someComment = "someComment";
String someUserName = "someUser";
NamespaceService someNamespaceService = mock(NamespaceService.class);
ReleaseService someReleaseService = mock(ReleaseService.class);
MessageSender someMessageSender = mock(MessageSender.class);
Namespace someNamespace = mock(Namespace.class);
ReleaseController releaseController = new ReleaseController(someReleaseService, someNamespaceService, someMessageSender, null);
when(someNamespaceService.findOne(someAppId, someCluster, someNamespaceName)).thenReturn(someNamespace);
releaseController.publish(someAppId, someCluster, someNamespaceName, someName, someComment, "test", false);
verify(someMessageSender, times(1)).sendMessage(Joiner.on(ConfigConsts.CLUSTER_NAMESPACE_SEPARATOR).join(someAppId, someCluster, someNamespaceName), Topics.APOLLO_RELEASE_TOPIC);
}
Aggregations