Skip to content

Commit

Permalink
remove Tests
Browse files Browse the repository at this point in the history
Signed-off-by: Pranshu-G <pranshu.grover18@gmail.com>
  • Loading branch information
Pranshu-G committed Aug 17, 2022
1 parent 54d28c2 commit 5f7426f
Showing 1 changed file with 62 additions and 31 deletions.
Expand Up @@ -11,34 +11,65 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
import org.eclipse.ditto.protocol.adapter.DittoProtocolAdapter;
import org.eclipse.ditto.protocol.adapter.ProtocolAdapter;
import org.eclipse.ditto.things.model.ThingId;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertEquals;

public class CloudEventsMapperTest {

private static final ThingId THING_ID = ThingId.of("thing:id");
private static final ProtocolAdapter ADAPTER = DittoProtocolAdapter.newInstance();

String payload =
"{\"specversion\": \"1.0\", \"id\":\"3212e\", \"source\":\"http:somesite.com\",\"type\":\"com.site.com\"}";
private CloudEventsMapper underTest;

@Before
public void setUp() {
underTest = new CloudEventsMapper();
}

@Test
public void validatePayload() {
Boolean expected = true;
Boolean actual = underTest.validatePayload(payload);
assertEquals(expected, actual);
}

@Test
private void CloudEventsStructuredMessage() {}
}
//import org.eclipse.ditto.base.model.common.DittoConstants;
//import org.eclipse.ditto.base.model.headers.DittoHeaders;
//import org.eclipse.ditto.connectivity.api.ExternalMessage;
//import org.eclipse.ditto.connectivity.api.ExternalMessageFactory;
//import org.eclipse.ditto.json.JsonFactory;
//import org.eclipse.ditto.json.JsonPointer;
//import org.eclipse.ditto.protocol.JsonifiableAdaptable;
//import org.eclipse.ditto.protocol.ProtocolFactory;
//import org.eclipse.ditto.protocol.adapter.DittoProtocolAdapter;
//import org.eclipse.ditto.protocol.adapter.ProtocolAdapter;
//import org.eclipse.ditto.things.model.ThingId;
//import org.junit.Before;
//import org.junit.Test;
//
//import java.util.Map;
//
//import static org.eclipse.ditto.connectivity.service.mapping.AbstractMessageMapper.extractPayloadAsString;
//import static org.junit.Assert.assertEquals;
//
//public class CloudEventsMapperTest {
//
// private static final ThingId THING_ID = ThingId.of("thing:id");
// private static final ProtocolAdapter ADAPTER = DittoProtocolAdapter.newInstance();
//
// public static void main(String[] args) {
// //
// ThingId thingId = ThingId.of("org.eclipse.ditto:thingID");
// final JsonifiableAdaptable adaptable =
// ProtocolFactory.wrapAsJsonifiableAdaptable(ProtocolFactory.newAdaptableBuilder
// (ProtocolFactory.newTopicPathBuilder(thingId).things().twin().commands().modify().build())
// .withPayload(ProtocolFactory
// .newPayloadBuilder(JsonPointer.of("/features"))
// .withValue(JsonFactory.nullLiteral())
// .build())
// .build());
// ExternalMessage message = ExternalMessageFactory.newExternalMessageBuilder(
// Map.of(ExternalMessage.CONTENT_TYPE_HEADER, DittoConstants.DITTO_PROTOCOL_CONTENT_TYPE))
// .withTopicPath(adaptable.getTopicPath())
// .withText(adaptable.toJsonString())
// .build();
// System.out.println(extractPayloadAsString(message));
// }
//
// String payload =
// "{\"specversion\": \"1.0\", \"id\":\"3212e\", \"source\":\"http:somesite.com\",\"type\":\"com.site.com\"}";
// private CloudEventsMapper underTest;
//
// @Before
// public void setUp() {
// underTest = new CloudEventsMapper();
// }
//
// @Test
// public void validatePayload() {
// Boolean expected = true;
// Boolean actual = underTest.validatePayload(payload);
// assertEquals(expected, actual);
// }
//
// @Test
// private void CloudEventsStructuredMessage() {}
//}

0 comments on commit 5f7426f

Please sign in to comment.