Examples of AcHost


Examples of com.atlassian.connect.play.java.AcHost


    @Before
    public void init() throws Throwable {
        acHostService = new AcHostServiceImpl(httpClient, acHostRepository);
        acHost = new AcHost();
        acHost.setPublicKey(TEST_PUBLIC_KEY);
        acHost.setBaseUrl(BASE_URL);

        when(httpClient.url(anyString(), any(AcHost.class), anyBoolean())).thenReturn(requestHolder);
        when(requestHolder.get()).thenReturn(Promise.pure(response));
View Full Code Here

Examples of com.atlassian.connect.play.java.AcHost

    private void init(String baseUrl) throws URISyntaxException {
        jwtAuthorizationGenerator = new JwtAuthorizationGenerator(jwtWriterFactory, 60 * 3);
        aUrl = baseUrl + "/foo";
        FakeApplication fakeApplication = Helpers.fakeApplication();
        Helpers.start(fakeApplication);
        acHost = new AcHost();
        acHost.setSharedSecret(NOT_SO_SECRET_SECRET);
        acHost.setBaseUrl(baseUrl);

        when(jwtWriterFactory.macSigningWriter(any(SigningAlgorithm.class), anyString())).thenReturn(jwtWriter);

View Full Code Here

Examples of com.atlassian.connect.play.java.AcHost

    @Override
    public void delete(final Long id) throws Throwable {
        JPA.withTransaction(new F.Function0<Void>() {
            @Override
            public Void apply() throws Throwable {
                final AcHost acHost = JPA.em().find(AcHost.class, id);

                if (acHost != null)
                {
                    JPA.em().remove(acHost);
                }
View Full Code Here

Examples of com.atlassian.connect.play.java.AcHost

        try {
            acHostOption = acHostRepository.findByKey(clientKey);
        } catch (Throwable throwable) {
            return Promise.throwing(throwable);
        }
        final AcHost acHost = acHostOption.orElse(new Supplier<Option<AcHost>>() {
            @Override
            public Option<AcHost> get() {
                try {
                    return acHostRepository.findByUrl(baseUrl);
                } catch (Throwable e) {
                    return none(AcHost.class);
                }
            }
        }).getOrElse(new AcHost());

        acHost.setKey(clientKey);
        acHost.setBaseUrl(baseUrl);
        acHost.setPublicKey(publicKey);
        acHost.setSharedSecret(sharedSecret);
        acHost.setName(name);

        try {
            acHostRepository.save(acHost);
        } catch (Throwable throwable) {
            return Promise.throwing(throwable);
View Full Code Here

Examples of com.atlassian.connect.play.java.AcHost

    public Result call(Http.Context context) throws Throwable
    {
        try
        {
            final String consumerKey = validator.validate(context.request());
            final AcHost host = AcHostModel.findByKey(consumerKey).getOrError(Suppliers.ofInstance("An error occured getting the host application"));

            context.args.put("ac_host", host);

            return delegate.call(context);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.