4.8 C
New York
Wednesday, April 2, 2025
Home Blog Page 3764

Don’t get stung by these frequent Reserving.com scams


Scams

From sending phishing emails to posting pretend listings, right here’s how fraudsters hunt for victims whilst you’re reserving your well-earned trip

No room for error: Don’t get stung by these common Booking.com scams

Reserving.com has grow to be one of many principal go-to platforms for vacationers in search of vacation lodging offers, but additionally for providers like automobile leases and airline tickets. In truth, it’s the most visited journey and tourism web site worldwide, having processed greater than a billion bookings in 2023, double the quantity recorded in 2016.

Clearly its recognition hasn’t escaped the eye of cybercriminals, who invariably flock to on-line providers with excessive site visitors. Trip reserving web sites are extremely profitable searching floor for victims.

Reserving.com itself has acknowledgement the magnitude of the issue and mentioned that it has seen a staggering “500 to 900% improve” in journey scams prior to now 18 months – and that this improve is essentially pushed by cybercriminals’ misuse of instruments comparable to ChatGPT since November 2022.

With trip season in full swing, let’s assessment among the commonest scams exploiting Reserving.com and what to look out for when utilizing this platform.

Phishing

Phishing emails, texts and social media messages are a staple in fraudsters’ arsenals. In these scams, they impersonate a good platform or group to trick the sufferer into believing they’re in touch with the positioning’s official consultant.

Clearly Reserving.com isn’t immune to those scams, and fraudsters proceed to churn out campaigns the place they pose because the platform or representatives of the lodge or one other service that the targets have booked by way of the positioning.

They typically provide you with a believable story the place they drum up a way of urgency and search to dupe the sufferer into clicking on a hyperlink the place they should make a brand new fee with a view to repair a purported error or face the prospect of dropping their reservation.

Figure 1. Booking scam
Determine 1. Rip-off try (Supply: Reddit)

The straightforward availability of generative AI instruments has opened the floodgates to waves of extra convincing and efficient scams. By producing phishing emails which can be grammatically right, contextually applicable, and freed from typical pink flags which may alert the recipient, they’ll simply trick folks and companies into downloading info-stealing malware on their units or into divulging delicate data or transferring cash.

Hijacked chats

Some scammers could go slightly additional than sending out random phishing messages. There have been a variety of stories of attackers discovering a technique to dupe their victims by way of the platform’s messaging system.

After discovering their manner into the accounts of the resorts the place holiday-makers made their reservations, they’ve contacted giant numbers of individuals straight by way of the in-app chat and urged them to make a fee to verify the reserving.

The ruse concerned an alleged error with the earlier fee, requiring them to pay once more and keep away from lacking out on their vacation. In different variations of this ploy, the fraudsters requested bank card or passenger information to confirm or verify the reserving.

Whereas this didn’t happen on account of a breach of the platform’s backend methods or infrastructure, you’re effectively suggested to look out for any communications that request your private or fee information.

Non-existent lodging

Many vacation properties seem like straight out of a fairy story. Certainly, a few of them are, fairly actually, unreal. Through the years, many holiday-makers have fallen sufferer to pretend itemizing scams the place cybercriminals promote a luxurious vacation dwelling that may be rented at an irresistible worth and instruct folks to pay, even by way of Reserving.com. Upon arriving, you’ll discover that the lodging doesn’t exist or the property will not be for lease.

In truth, quickly sufficient, the platform’s personal methods kick in – the pretend listings are found and eliminated. Nevertheless, your trip could also be ruined by then, so that you’re higher off doing all of your diligence earlier than reserving.

Search for evaluations and scores for the place, test if the value is roughly much like these for “competing” homes or flats, and reverse-search the picture to see what comes up – it’s doubtless a free inventory picture or it was stolen from different web sites. The underside line is, if one thing seems too good to be true, it often is.

Faux job presents

The textual content or social media message is simple sufficient: “We’d like somebody to guage lodge bookings. We pay between $200 and $1,000. All you could do is price or just like the lodge on (a pretend Reserving.com hyperlink).” That is how the message providing an irresistible facet hustle, supposedly from Reserving.com, begins. It’s additionally a variation on fashionable work-from-home scams.

Figure 2. Booking scam
Determine 2. Bogus job provide (supply: Reddit)

You’re then requested to pay an advance charge to safe their jobs and/or to ship their private data like Social Safety numbers or different particulars, which can be utilized to commit id theft. In some instances, the scammers could also be after your bitcoin or different crypto.

Methods to keep secure? Reserving.com doesn’t rent folks to assessment resorts, they usually don’t rent folks by way of unsolicited textual content messages. Hiring as such takes place by Reserving Careers, and there’s no job emptiness on the platform requiring folks to assessment resorts.

12 suggestions for avoiding Reserving.com and different journey scams

The following tips will go a good distance in direction of serving to you keep secure whereas utilizing Reserving.com.:

  • Everytime you’re contacted by somebody who represents Reserving.com or a lodge the place you’ve booked your keep, be careful for the standard indicators of a phishing electronic mail, comparable to requests for pressing motion.
  • All the time confirm that emails got here from their official area and be cautious of slight misspellings or variations. A lot of trusted electronic mail addresses are additionally listed on the positioning itself.
  • If you happen to obtain any suspicious communication, go on to the web site and log into your account to confirm any claims.
  • Reserving.com by no means asks for data like your full bank card particulars, social safety quantity, or passwords by way of electronic mail or chat.
  • Keep away from clicking on hyperlinks in unsolicited emails or messages.
  • Make funds by the official Reserving.com platform. Keep away from transferring cash on to the lodging supplier.
  • Test evaluations and scores of the lodging on Reserving.com and search for evaluations which can be genuine and detailed. Examine and cross-check the lodging particulars and pictures on different journey web sites or assessment platforms.
  • Guarantee your units have up-to-date safety software program to guard towards malware and phishing makes an attempt.
  • Preserve your working system and different software program up to date to guard towards safety vulnerabilities.
  • Defend your on-line accounts with robust and distinctive passwords or passphrases and two-factor authentication.
  • If you happen to encounter any suspicious exercise, report the problem to the platform’s customer support.
  • If you happen to suspect that your fee data has been compromised, inform your financial institution or bank card supplier instantly.

Bon voyage!

BEFORE YOU GO: Occurring trip quickly? Keep one step forward of journey scams

Signifyd: An Energetic Metadata Pioneer – Atlan

0


Breaking Down Info Silos with Atlan

The Energetic Metadata Pioneers sequence options Atlan prospects who’ve not too long ago accomplished a radical analysis of the Energetic Metadata Administration market. Paying ahead what you’ve realized to the following information chief is the true spirit of the Atlan neighborhood! So that they’re right here to share their hard-earned perspective on an evolving market, what makes up their trendy information stack, progressive use instances for metadata, and extra.

On this installment of the sequence, we meet Pranav Gandhi, Head of Information & Analytics at Signifyd, a pacesetter in eCommerce Fraud Safety expertise supporting hundreds of shops in over 100 nations. Pranav shares how an organization constructed on information science will use Atlan to interrupt down data silos, driving quick, assured decision-making for technical and enterprise customers, alike.

This interview has been edited for brevity and readability.


Might you inform us a bit about your self, your background, and what drew you to Information & Analytics?

I lead Analytics Engineering and Information Analytics at Signifyd, and have been on the firm for about 4 and a half years now. 

I received began in Information & Analytics once I joined Jet.com, an eCommerce retailer that was acquired by Walmart. Once we moved to Walmart, I pivoted into pricing analytics, which aligned with my background in Economics. It fascinated me to see how information might be utilized in so some ways and totally different features.

Would you thoughts describing your information crew?

Signifyd is exclusive in that we’re a Information Science firm first. It’s our product, and isn’t a method to an finish. We earn money once we present choices. Our crew is uniquely organized, and there are lively conversations about working as a knowledge product crew. 

So, we’ve a Determination Science crew, sitting in a unique a part of the group however using loads of information to assist make these choices. Our information crew is basically a part of our product group, and we deal with information as a first-class citizen inside our group, akin to a product. 

My crew is made up for Analytics Engineers, who’re hands-on with information and creating fashions for others to make use of. Then there are Analysts, a few of whom are centralized and assist groups like Product, Advertising and marketing, Information Science, and Finance. We’ve already begun decentralizing some analytical features in a hub-and-spoke kind of mannequin, they usually’re already reaching the size the place their coordination with our centralized Enterprise Analysts and Analytics Engineers is working properly.

Why seek for an Energetic Metadata Administration resolution? What was lacking?

The best way our groups had been initially arrange was creating silos in how we managed our data. Root Trigger Evaluation might additionally add further complexity for our information groups, even with easy asks. We’re additionally consistently testing and releasing new merchandise, which implies the best way prospects ship us information adjustments regularly. The info crew sits far on the “proper” of all this, and a few context was typically lacking, so we must ask questions in Product and Engineering channels on Slack. That took time and put strain on our analysts, particularly those that work to make our prospects profitable.

If the client isn’t being served in an optimum means, that may be a drag on their enterprise. So, ensuring individuals had entry to the best data and understood it was paramount. We additionally realized that there have been so many siloed methods of organizing information, that it was even more durable to have a transparent method to change data throughout them.

So, we began to have a look at centralized cataloging instruments. We thought of Looker, as a result of that was the first place the place our information landed, however discovered it was too “late” within the information workflow for that data to dwell. That’s once we began to contemplate Atlan.

If you had been evaluating the market, what stood out to you? What was vital?

Within the Energetic Metadata Administration market, I feel there’s an identification disaster from loads of distributors. Are you fixing for technical customers to grasp their workflows higher, or are you fixing for enterprise customers who don’t have any clue what these ideas are? 

What was robust for us is that we wished our selection to resolve as many use instances as doable, as a result of we need to be cost-efficient as a way to scale in an optimized method. We couldn’t afford to have a device that solely solves Information Engineering and Analysts’ ache factors, whereas leaving the enterprise customers in their very own silo once they’re the customers who may gain advantage essentially the most.

Once we talked to totally different distributors in the course of the analysis, the largest factor we realized was that for those who aren’t fixing for each personas, then you need to assume the enterprise consumer isn’t going to enter the device. With Atlan, there’s the Chrome Extension, so enterprise customers don’t have to fret about needing to signal into a brand new device. With the opposite approaches, you may create personas, however utilization isn’t going to be nice all the best way to the best. 

For our extra technical customers, we knew they might use it. However we appreciated that Atlan had assist for non-technical customers, and it made it a lot simpler for even a Information Analyst to do enrichment, versus asking them to grasp all of the technical components of how metadata is scraped earlier than they might add worth.

The place we landed in our analysis is that Atlan had the product that sat most squarely within the center between enterprise customers and technical customers.

What do you plan on creating with Atlan? Do you will have an concept of what use instances you’ll construct, and the worth you’ll drive?

We’ve began with amassing some enterprise use instances and have a pair which might be fairly data-heavy the place we’re creating issues like buyer well being scores. These scores proactively assist our buyer success crew perceive details about our retailers. Getting individuals into one, central location the place they will retrieve that data goes to assist.

The best way we’re serious about that is that we’re not going to have a ton of customers on Atlan instantly. We’re going to roll it out by use case and we’re going to slowly enrich it, as a result of it’s the kind of device the place for those who transfer too shortly and issues aren’t up to date, then you definately’ve simply created extra technical debt in a unique device. At that time, you’re asking the query of whether or not dangerous information is best than no information. We don’t need that to be the case. So, we’re going to predominantly give attention to enterprise groups that come to the information crew with loads of questions.

Some groups have their very own documentation, Confluence is used sparingly, and we’re a really Slack-heavy group. We’re kicking tires proper now to see what works internally, however we’re wanting ahead to having information contextualized and tagged on Slack by way of Atlan. I feel it is going to be essential to get that arrange accurately so customers will see worth shortly. We can be extra clever, and if we see that 20 customers on Slack are asking the identical questions on an asset, then we will prioritize documenting it.

Did we miss something?

I’d simply say we’re wanting ahead to this journey. What I’m specializing in, particularly in our group the place we worth fiscal accountability, is how we present worth to the enterprise and our inner stakeholders. You want buy-in to do one thing like this, and it requires change administration. So, our crew wants to ensure we’re getting essentially the most out of Atlan, but additionally that each enterprise and technical stakeholders are benefitting, too.

Photograph by Bench Accounting on Unsplash

NVIDIA Reveals Off the Breadth of its Accelerated Computing Platform at SIGGRAPH


This week, SIGGRAPH 2024 is being held in Denver, Colorado. The occasion, now in its 50th 12 months, began as an business convention for graphics analysis however has now expanded to incorporate different subjects, reminiscent of AI and simulation. This parallels NVIDIA’s journey from an organization that made graphics playing cards to the world’s largest accelerated computing vendor. Because it does in any respect occasions, NVIDIA introduced a variety of improvements highlighting how its platform permits all accelerated computing workloads – from digital to bodily.

Superior AI fashions for creating 3D objects, digital people, and simulating robots are amongst these improvements. An in depth have a look at the information is beneath.

NIM and Omniverse Developments

NVIDIA inference microservices (NIM) is a framework designed to simplify the deployment of generative AI (gen AI). It offers pre-built AI fashions and containers that may be built-in into apps by way of software programming interfaces (APIs).

In partnership with WPP Open X, the Coca-Cola Firm makes use of NVIDIA Omniverse and NIM to create personalised 3D adverts for over 100 markets. At SIGGRAPH, WPP, a number one advertising and communications companies firm, introduced that Coca-Cola has built-in NIM for Common Scene Description (OpenUSD) into its Prod X manufacturing studio. This enables Coca-Cola to customise and assemble its belongings and create culturally related adverts on a world scale.

Associated:What’s an AI Manufacturing facility?

Hugging Face’s inference as a service is now powered by NIM and operating on DGX Cloud. This provides Hugging Face’s 4 million builders quicker efficiency and quick access to serverless inference utilizing NVIDIA’s H100 graphics processing items (GPUs). The DGX Cloud, designed with prime cloud suppliers, gives a totally optimized setup.

“Hugging Face’s inference as a service with NVIDIA NIM offers as much as 5x greater throughput than with out an NIM and the flexibility to quickly experiment with production-level deployment with API stability, safety, patching, and enterprise-grade help,” stated Kari Briski, vice chairman of generative AI software program product administration at NVIDIA, throughout a SIGGRAPH information briefing.

fVDB Framework for Digital Representations

NVIDIA launched fVDB, a brand new deep-learning framework for creating AI-ready digital representations of the true world. Constructed on OpenVDB, fVDB is designed for simulating and rendering volumetric knowledge reminiscent of water, fireplace, smoke, and clouds. It converts uncooked knowledge from methods like neural radiance fields (NeRFs) and lidar into digital environments that AI can use.

fVDB can deal with environments 4 instances bigger than earlier frameworks and operates 3.5 instances quicker. It’s additionally interoperable with huge real-world datasets. The framework will quickly be obtainable as a part of NVIDIA’s NIM inference microservices, simplifying integration for builders. By remodeling detailed real-world knowledge into AI-ready digital environments, fVDB may also help practice AI in autonomous automobiles, robots, and high-performance 3D deep studying.

New Gen AI Fashions for OpenUSD

NVIDIA has launched generative AI to OpenUSD, increasing its use in robotics, industrial design, and engineering. NVIDIA’s generative AI fashions for OpenUSD can be found as NIM microservices. Utilizing the fashions, builders can combine AI copilots and brokers into USD workflows, increasing the chances in 3D worlds.

“We constructed the world’s first gen AI fashions that may perceive OpenUSD-based language, geometry, supplies, physics, and areas. Three NIMs at the moment are obtainable in preview on the NVIDIA API catalog: USD Code, which may reply OpenUSD information questions and generate OpenUSD Python code; USD Search, which permits builders to look by means of huge libraries of OpenUSD 3D picture knowledge; and USD Validate, which checks the compatibility of uploaded information in opposition to OpenUSD launch variations,” stated Rev Lebaredian, vice chairman of Omniverse and simulation expertise at NVIDIA.

Based on Lebaredian, further NIM microservices are coming quickly. They embody USD Format for assembling scenes from textual content prompts; USD SmartMaterial for making use of reasonable supplies to 3D objects, fVDB Mesh Era for creating meshes primarily based on point-cloud knowledge; fVDB Physics Tremendous-Res for making high-resolution physics simulations, and fVDB NeRF-XL for producing large-scale NeRFs.

Moreover, NVIDIA is increasing OpenUSD with new connectors for unified robotics description format (URDF) and computational fluid dynamics (CFD) simulations. These developments will make it simpler for non-3D specialists to create digital worlds, broadening OpenUSD and Omniverse capabilities for brand new industries.

Getty Photos and Shutterstock Enhancements

NVIDIA introduced the final availability of the Getty Photos 4K picture technology API and Shutterstock’s 3D asset technology service, powered by NVIDIA’s Edify NIMs. These instruments permit content material creators to design high-quality 4K photos and detailed 3D belongings utilizing textual content or picture prompts. Each are constructed utilizing NVIDIA’s visible AI foundry with the Edify structure, a multimodal gen AI system.

“The Shutterstock 3D service powered by Edify is coming into industrial availability. Many enterprises have been asking for this. These 3D belongings could be introduced instantly into in style digital content material creation (DCC) instruments, tweaked, and used for prototyping and set dressing,” stated Briski. Along with producing 3D belongings to populate a scene, NVIDIA and Shutterstock are additionally offering the flexibility to generate lighting and backgrounds for these scenes with Edify.”

Developer Program for Robotics

NVIDIA rolled out new instruments and companies to assist builders create the following technology of humanoid robots. These embody NIM microservices for robotic simulation and studying, the OSMO platform for managing advanced robotics duties, and a teleoperation workflow that makes use of AI and simulation to coach robots. Two examples of the NIM microservices for robotic simulation are MimicGen and Robocasa. MimicGen trains robots to imitate human actions captured by units like Apple Imaginative and prescient Professional, whereas Robocasa generates duties and reasonable environments for robots to apply in.

“We’re making these new NIMS teleoperation applied sciences and OSMO obtainable to humanoid robotic builders as a part of a brand new developer program. Corporations like 1x, Boston Dynamics, Discipline AI, Determine, Fourier, Galbot, LimX Dynamics, Mentee, Neura Robotics, RobotEra, and Skild AI are all becoming a member of,” stated Lebaredian.

By means of this system, builders can get early entry to new instruments and updates, reminiscent of the newest variations of Isaac Sim, Isaac Lab, Jetson Thor, and Venture GR00T general-purpose humanoid fashions.

At SIGGRAPH, NVIDIA showcases an AI-enabled teleoperation workflow that makes use of minimal human knowledge to create artificial movement. This course of entails capturing demonstrations with Apple Imaginative and prescient Professional, simulating them in Isaac Sim, and utilizing the MimicGen NIM to make artificial datasets. These datasets practice the Venture GR00T humanoid mannequin.

Developments in Bodily AI

“How can we construct generative AI for the bodily world? We’d like fashions that may perceive and carry out advanced duties within the bodily world. Three computing platforms are required: NVIDIA AI and DGX supercomputers, Omniverse and OVX supercomputers, and NVIDIA Jetson robotic computer systems,” stated Lebaredian.

These applied sciences assist robots perceive and navigate the bodily world. Along with launching new NIM microservices at SIGGRAPH, NVIDIA additionally launched a Metropolis reference workflow to help builders in coaching robots. NIM microservices and the Metropolis reference workflow assist builders construct good areas with superior robotics and AI methods for hospitals, factories, warehouses, and extra. They rework bodily AI by aiding robots to understand, purpose, and navigate their environment.

By offering these superior instruments and workflows, NVIDIA is enhancing the capabilities of AI methods and making them extra accessible for builders to create real-world functions throughout totally different industries.

Abstract

At SIGGRAPH 2024, NVIDIA highlighted the significance of accelerated computing by showcasing a spread of improvements that emphasize AI, generative fashions, and digital simulations. Key developments included the NVIDIA inference microservices (NIM) framework, fVDB for digital environments, new generative AI fashions for OpenUSD, and superior instruments for robotics. These applied sciences reveal NVIDIA’s dedication to enhancing the capabilities and accessibility of AI and simulation throughout industries, reinforcing its place as a pacesetter in accelerated computing.

Zeus Kerravala is the founder and principal analyst with ZK Analysis.

Learn his different Community Computing articles right here.



Gartner Spotlights AI, Safety in 2024 Hype Cycle for Rising Tech


Enterprises ought to be being attentive to rising applied sciences — however additionally they must strategize tips on how to exploit these applied sciences consistent with their capacity to deal with unproven applied sciences, Gartner mentioned.

Gartner’s 2024 Hype Cycle for Rising Applied sciences, launched this week, covers autonomous AI, developer productiveness, whole expertise, and human-centric safety and privateness. Cybersecurity leaders can profit most by figuring out their organizations — and their strengths and weaknesses — earlier than deciding tips on how to incorporate these applied sciences into the enterprise. 

Gartner positioned generative AI know-how over the “Peak of Inflated Expectations,” highlighting the necessity for enterprises to contemplate what return on funding these techniques present. Simply final 12 months, organizations have been leaping on something that included generative AI. Now, organizations are slowing down to judge these applied sciences towards their particular setting and necessities.

august_2024_ethc.png

“At the beginning, it’s important to gauge your maturity earlier than you deploy know-how,” says Arun Chandrasekaran, Distinguished VP Analyst at Gartner. “A know-how may fit very properly in a single group, however might not work properly in one other group.”

Within the cybersecurity enviornment, Gartner calls out human-centric safety and privateness, urging organizations to develop resilience by making a tradition of mutual belief and shared threat. Safety controls usually depend on the premise that people behave securely when the truth is that staff will bypass too-stringent safety controls with a view to full their enterprise duties.

Getting people concerned early within the know-how deployment lifecycle and giving groups sufficient coaching may also help them work in a extra synchronous means with safety know-how, says Chandrasekaran.  

Rising applied sciences supporting human-centric safety and privateness embody AI TRiSM, cybersecurity mesh structure, digital immune system, disinformation safety, federated machine studying, and homomorphic encryption, in line with Gartner.

AI Hype is Sky Excessive

In terms of Autonomous AI applied sciences that may function with minimal human oversight–corresponding to multiagent techniques, massive motion fashions, machine prospects, humanoid working robots, autonomous brokers and reinforcement studying–know-how leaders ought to mood their expectations.

“Whereas the applied sciences are advancing very quickly, the expectations and hype round these applied sciences can be sky excessive, which implies that there’s going to be some stage of unhappiness. There’s going to be some stage of disillusionment. That is inevitable, not as a result of the know-how is unhealthy, however due to our expectations round it,” Chandrasekaran says. “Within the close to time period, we’ll see some recalibration when it comes to expectations, and a few failures in that area are inevitable.”

Gartner’s Hype Cycle additionally centered on instruments that may assist enhance developer productiveness, together with AI-augmented software program engineering, cloud-native, GitOps, inner developer portals, immediate engineering, and WebAssembly. 

“We can’t deploy know-how for know-how’s sake. Now we have to essentially deploy it in a fashion the place the applied sciences are functioning in a extra harmonious means with human beings, and the human beings are skilled on the sufficient and the suitable utilization of these applied sciences,” Chandrasekaran says.

The Hype Cycle for Rising Applied sciences is culled from the evaluation of greater than 2,000 applied sciences that Gartner says have the potential to ship “transformational advantages” over the following two to 10 years. 



Take a look at-Driving HTML Templates


foo

Let’s examine the right way to do it in phases: we begin with the next take a look at that
tries to compile the template. In Go we use the usual html/template bundle.

Go

  func Test_wellFormedHtml(t *testing.T) {
    templ := template.Should(template.ParseFiles("index.tmpl"))
    _ = templ
  }

In Java, we use jmustache
as a result of it is quite simple to make use of; Freemarker or
Velocity are different frequent selections.

Java

  @Take a look at
  void indexIsSoundHtml() {
      var template = Mustache.compiler().compile(
              new InputStreamReader(
                      getClass().getResourceAsStream("/index.tmpl")));
  }

If we run this take a look at, it can fail, as a result of the index.tmpl file does
not exist. So we create it, with the above damaged HTML. Now the take a look at ought to move.

Then we create a mannequin for the template to make use of. The applying manages a todo-list, and
we are able to create a minimal mannequin for demonstration functions.

Go

  func Test_wellFormedHtml(t *testing.T) {
    templ := template.Should(template.ParseFiles("index.tmpl"))
    mannequin := todo.NewList()
    _ = templ
    _ = mannequin
  }

Java

  @Take a look at
  void indexIsSoundHtml() {
      var template = Mustache.compiler().compile(
              new InputStreamReader(
                      getClass().getResourceAsStream("/index.tmpl")));
      var mannequin = new TodoList();
  }

Now we render the template, saving the leads to a bytes buffer (Go) or as a String (Java).

Go

  func Test_wellFormedHtml(t *testing.T) {
    templ := template.Should(template.ParseFiles("index.tmpl"))
    mannequin := todo.NewList()
    var buf bytes.Buffer
    err := templ.Execute(&buf, mannequin)
    if err != nil {
      panic(err)
    }
  }

Java

  @Take a look at
  void indexIsSoundHtml() {
      var template = Mustache.compiler().compile(
              new InputStreamReader(
                      getClass().getResourceAsStream("/index.tmpl")));
      var mannequin = new TodoList();
  
      var html = template.execute(mannequin);
  }

At this level, we wish to parse the HTML and we anticipate to see an
error, as a result of in our damaged HTML there’s a div ingredient that
is closed by a p ingredient. There’s an HTML parser within the Go
normal library, however it’s too lenient: if we run it on our damaged HTML, we do not get an
error. Fortunately, the Go normal library additionally has an XML parser that may be
configured to parse HTML (due to this Stack Overflow reply)

Go

  func Test_wellFormedHtml(t *testing.T) {
    templ := template.Should(template.ParseFiles("index.tmpl"))
    mannequin := todo.NewList()
    
    // render the template right into a buffer
    var buf bytes.Buffer
    err := templ.Execute(&buf, mannequin)
    if err != nil {
      panic(err)
    }
  
    // examine that the template will be parsed as (lenient) XML
    decoder := xml.NewDecoder(bytes.NewReader(buf.Bytes()))
    decoder.Strict = false
    decoder.AutoClose = xml.HTMLAutoClose
    decoder.Entity = xml.HTMLEntity
    for {
      _, err := decoder.Token()
      swap err {
      case io.EOF:
        return // We're performed, it is legitimate!
      case nil:
        // do nothing
      default:
        t.Fatalf("Error parsing html: %s", err)
      }
    }
  }

supply

This code configures the HTML parser to have the best stage of leniency
for HTML, after which parses the HTML token by token. Certainly, we see the error
message we wished:

--- FAIL: Test_wellFormedHtml (0.00s)
    index_template_test.go:61: Error parsing html: XML syntax error on line 4: sudden finish ingredient 

In Java, a flexible library to make use of is jsoup:

Java

  @Take a look at
  void indexIsSoundHtml() {
      var template = Mustache.compiler().compile(
              new InputStreamReader(
                      getClass().getResourceAsStream("/index.tmpl")));
      var mannequin = new TodoList();
  
      var html = template.execute(mannequin);
  
      var parser = Parser.htmlParser().setTrackErrors(10);
      Jsoup.parse(html, "", parser);
      assertThat(parser.getErrors()).isEmpty();
  }

supply

And we see it fail:

java.lang.AssertionError: 
Anticipating empty however was:<[<1:13>: Unexpected EndTag token [] when in state [InBody],

Success! Now if we copy over the contents of the TodoMVC
template
to our index.tmpl file, the take a look at passes.

The take a look at, nonetheless, is simply too verbose: we extract two helper capabilities, in
order to make the intention of the take a look at clearer, and we get

Go

  func Test_wellFormedHtml(t *testing.T) {
    mannequin := todo.NewList()
  
    buf := renderTemplate("index.tmpl", mannequin)
  
    assertWellFormedHtml(t, buf)
  }

supply

Java

  @Take a look at
  void indexIsSoundHtml() {
      var mannequin = new TodoList();
  
      var html = renderTemplate("/index.tmpl", mannequin);
  
      assertSoundHtml(html);
  }

supply

Stage 2: testing HTML construction

What else ought to we take a look at?

We all know that the seems to be of a web page can solely be examined, in the end, by a
human how it’s rendered in a browser. Nevertheless, there may be typically
logic in templates, and we wish to have the ability to take a look at that logic.

One may be tempted to check the rendered HTML with string equality,
however this method fails in observe, as a result of templates comprise quite a lot of
particulars that make string equality assertions impractical. The assertions
grow to be very verbose, and when studying the assertion, it turns into troublesome
to grasp what it’s that we’re making an attempt to show.

What we’d like
is a method to claim that some elements of the rendered HTML
correspond to what we anticipate, and to ignore all the small print we do not
care about.
A technique to do that is by working queries with the CSS selector language:
it’s a highly effective language that enables us to pick out the
parts that we care about from the entire HTML doc. As soon as we now have
chosen these parts, we (1) depend that the variety of ingredient returned
is what we anticipate, and (2) that they comprise the textual content or different content material
that we anticipate.

The UI that we’re imagined to generate seems to be like this:

Take a look at-Driving HTML Templates

There are a number of particulars which can be rendered dynamically:

  1. The variety of gadgets and their textual content content material change, clearly
  2. The fashion of the todo-item adjustments when it is accomplished (e.g., the
    second)
  3. The “2 gadgets left” textual content will change with the variety of non-completed
    gadgets
  4. One of many three buttons “All”, “Energetic”, “Accomplished” shall be
    highlighted, relying on the present url; as an example if we determine that the
    url that exhibits solely the “Energetic” gadgets is /lively, then when the present url
    is /lively, the “Energetic” button must be surrounded by a skinny crimson
    rectangle
  5. The “Clear accomplished” button ought to solely be seen if any merchandise is
    accomplished

Every of this issues will be examined with the assistance of CSS selectors.

This can be a snippet from the TodoMVC template (barely simplified). I
haven’t but added the dynamic bits, so what we see right here is static
content material, supplied for instance:

index.tmpl

  

supply